VBScript & HTM 
Author Message
 VBScript & HTM

Hi Folks
I have this script working when *.vbs, but I cannot make it run from a html
page
Can you help me with this?

set ws = WScript.CreateObject("WScript.Shell")
set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives
For each d in dc
 if d.DriveType = 4 then
  drive = d.Path
  ws.Run ("explorer " & drive)
 end if
Next

----------------------------

<HTML>
<HEAD><TITLE>A Simple First Page</TITLE>
<SCRIPT  LANGUAGE="VBScript">
<!--
Sub Button1_OnClick
set ws = WScript.CreateObject("WScript.Shell")
set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives
For each d in dc
 if d.DriveType = 4 then
  drive = d.Path
  ws.Run ("explorer " & drive)
 end if
Next

End Sub
-->
</SCRIPT>
</HEAD>
<BODY>
<H3>A Simple First Page</H3><HR>
<FORM><INPUT NAME="Button1" TYPE="BUTTON" VALUE="Click Here"></FORM>
</BODY>
</HTML>



Mon, 15 Aug 2005 05:40:51 GMT  
 VBScript & HTM
Change: set ws = WScript.CreateObject("WScript.Shell")

To: set ws = CreateObject("WScript.Shell")

--

Bill James
Microsoft MVPDTS

Win9x VBScript Utilities ? www.billsway.com/vbspage/
Windows Tweaks & Tips ? www.billsway.com/notes_public/


Quote:
> Hi Folks
> I have this script working when *.vbs, but I cannot make it run from a
html
> page
> Can you help me with this?

> set ws = WScript.CreateObject("WScript.Shell")
> set fso = CreateObject("Scripting.FileSystemObject")
> Set dc = fso.Drives
> For each d in dc
>  if d.DriveType = 4 then
>   drive = d.Path
>   ws.Run ("explorer " & drive)
>  end if
> Next

> ----------------------------

> <HTML>
> <HEAD><TITLE>A Simple First Page</TITLE>
> <SCRIPT  LANGUAGE="VBScript">
> <!--
> Sub Button1_OnClick
> set ws = WScript.CreateObject("WScript.Shell")
> set fso = CreateObject("Scripting.FileSystemObject")
> Set dc = fso.Drives
> For each d in dc
>  if d.DriveType = 4 then
>   drive = d.Path
>   ws.Run ("explorer " & drive)
>  end if
> Next

> End Sub
> -->
> </SCRIPT>
> </HEAD>
> <BODY>
> <H3>A Simple First Page</H3><HR>
> <FORM><INPUT NAME="Button1" TYPE="BUTTON" VALUE="Click Here"></FORM>
> </BODY>
> </HTML>



Mon, 15 Aug 2005 05:52:53 GMT  
 VBScript & HTM
In response to your crossposted message, this will not work with the default
IE security settings.  I hope that you're trying to do this in the intranet
zone in an environment where you can safely have your security settings low
enough to allow this.

Ray at work


Quote:
> Hi Folks
> I have this script working when *.vbs, but I cannot make it run from a
html
> page
> Can you help me with this?

> set ws = WScript.CreateObject("WScript.Shell")
> set fso = CreateObject("Scripting.FileSystemObject")
> Set dc = fso.Drives
> For each d in dc
>  if d.DriveType = 4 then
>   drive = d.Path
>   ws.Run ("explorer " & drive)
>  end if
> Next

> ----------------------------

> <HTML>
> <HEAD><TITLE>A Simple First Page</TITLE>
> <SCRIPT  LANGUAGE="VBScript">
> <!--
> Sub Button1_OnClick
> set ws = WScript.CreateObject("WScript.Shell")
> set fso = CreateObject("Scripting.FileSystemObject")
> Set dc = fso.Drives
> For each d in dc
>  if d.DriveType = 4 then
>   drive = d.Path
>   ws.Run ("explorer " & drive)
>  end if
> Next

> End Sub
> -->
> </SCRIPT>
> </HEAD>
> <BODY>
> <H3>A Simple First Page</H3><HR>
> <FORM><INPUT NAME="Button1" TYPE="BUTTON" VALUE="Click Here"></FORM>
> </BODY>
> </HTML>



Mon, 15 Aug 2005 06:00:25 GMT  
 VBScript & HTM
To by-pass IE security try making it an HTA.

Bryan


Quote:
> Hi Folks
> I have this script working when *.vbs, but I cannot make it run from a
html
> page
> Can you help me with this?

> set ws = WScript.CreateObject("WScript.Shell")
> set fso = CreateObject("Scripting.FileSystemObject")
> Set dc = fso.Drives
> For each d in dc
>  if d.DriveType = 4 then
>   drive = d.Path
>   ws.Run ("explorer " & drive)
>  end if
> Next

> ----------------------------

> <HTML>
> <HEAD><TITLE>A Simple First Page</TITLE>
> <SCRIPT  LANGUAGE="VBScript">
> <!--
> Sub Button1_OnClick
> set ws = WScript.CreateObject("WScript.Shell")
> set fso = CreateObject("Scripting.FileSystemObject")
> Set dc = fso.Drives
> For each d in dc
>  if d.DriveType = 4 then
>   drive = d.Path
>   ws.Run ("explorer " & drive)
>  end if
> Next

> End Sub
> -->
> </SCRIPT>
> </HEAD>
> <BODY>
> <H3>A Simple First Page</H3><HR>
> <FORM><INPUT NAME="Button1" TYPE="BUTTON" VALUE="Click Here"></FORM>
> </BODY>
> </HTML>



Mon, 15 Aug 2005 06:27:30 GMT  
 VBScript & HTM
Thanks to all.
It worked great!
and yes, I'm using hta, just to create a menu, and I wanted to add the
"Browse this CD utility"
once again,

thanks!

R.


Quote:
> To by-pass IE security try making it an HTA.

> Bryan



> > Hi Folks
> > I have this script working when *.vbs, but I cannot make it run from a
> html
> > page
> > Can you help me with this?

> > set ws = WScript.CreateObject("WScript.Shell")
> > set fso = CreateObject("Scripting.FileSystemObject")
> > Set dc = fso.Drives
> > For each d in dc
> >  if d.DriveType = 4 then
> >   drive = d.Path
> >   ws.Run ("explorer " & drive)
> >  end if
> > Next

> > ----------------------------

> > <HTML>
> > <HEAD><TITLE>A Simple First Page</TITLE>
> > <SCRIPT  LANGUAGE="VBScript">
> > <!--
> > Sub Button1_OnClick
> > set ws = WScript.CreateObject("WScript.Shell")
> > set fso = CreateObject("Scripting.FileSystemObject")
> > Set dc = fso.Drives
> > For each d in dc
> >  if d.DriveType = 4 then
> >   drive = d.Path
> >   ws.Run ("explorer " & drive)
> >  end if
> > Next

> > End Sub
> > -->
> > </SCRIPT>
> > </HEAD>
> > <BODY>
> > <H3>A Simple First Page</H3><HR>
> > <FORM><INPUT NAME="Button1" TYPE="BUTTON" VALUE="Click Here"></FORM>
> > </BODY>
> > </HTML>



Mon, 15 Aug 2005 06:56:30 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. VBScript & HTM

2. include htm in an htm

3. Using Form Input data in VBScript .HTM (not .ASP)

4. Mac&StyleScript&EPS&ClarisWorks&Ill7

5. VBS in a HTM or HTML page ?

6. VB-constants in a htm-file?

7. SSTab an HTM page in IE4

8. Deletin an HTM element with JS?

9. changing htm files in frames with jscript

10. javascript engine execution speed - Netscape v IE (30k code in htm file)

11. Storing HTM file in database

12. Creating an .htm file on the fly ?? :-)

 

 
Powered by phpBB® Forum Software