Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript or WScript error in HTML 1

Status
Not open for further replies.

EAS

Programmer
May 21, 2001
25
GB
Can anyone point out my error in the following code? The lines 18 to 23 work seperately as a vbs file. I'm trying to take my Intranet users straight to their desktops. We are a "Microsoft Site" so it's all IE and NT/95/98.

1 <!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>
2 <html>
3 <BODY bgcolor=&quot;palegoldenrod&quot; ID=&quot;prgmain&quot;>
4 <OBJECT ID=&quot;WebBrowserControl&quot; WIDTH=90% HEIGHT=90%
5 CLASSID=&quot;CLSID:EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B&quot;>
6 <PARAM NAME=&quot;Height&quot; VALUE=&quot;600&quot;>
7 <PARAM NAME=&quot;Width&quot; VALUE=&quot;350&quot;>
8 <PARAM NAME=&quot;AutoSize&quot; VALUE=&quot;0&quot;>
9 <PARAM NAME=&quot;ViewMode&quot; VALUE=&quot;1&quot;>
10 <PARAM NAME=&quot;AutoSizePercentage&quot; VALUE=&quot;0&quot;>
11 <PARAM NAME=&quot;AutoArrange&quot; VALUE=&quot;1&quot;>
12 <PARAM NAME=&quot;NoClientEdge&quot; VALUE=&quot;1&quot;>
13 <PARAM NAME=&quot;AlignLeft&quot; VALUE=&quot;0&quot;>
14 </OBJECT>
15 <SCRIPT LANGUAGE=&quot;VBScript&quot;>
16 <!--
17 Sub WebBrowserControl_onMouseOver()
18 Dim Shell
19 Dim DesktopPath
20
21 Set Shell = WScript.CreateObject(&quot;WScript.Shell&quot;)
22
23 DesktopPath = Shell.SpecialFolders(&quot;Desktop&quot;)
24
25 WebBrowserControl.Navigate ( DesktopPath )
26 end sub
27 -->
28 </SCRIPT>
29 </BODY>
30 </HTML>

Thanks in advance!
Liz
 


eas,

Use:

For-

Set Shell = WScript.CreateObject(&quot;WScript.Shell&quot;)

use -
Set Shell = Server.CreateObject(&quot;WScript.Shell&quot;)

Fengshui1998

 
Thanks but I still get an error on page in my html and if I test it in my vbs I get an object required error. Do I have to add extra code to use Server?
 
I think I've solved it - as it's on our intranet I can set tha activex security to low and just have:
Set Shell = CreateObject(&quot;WScript.Shell&quot;)
This works fine (or appears to so far!). Thanks for your help - it pointed me in the right direction.
Liz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top