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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scripting Vb

Status
Not open for further replies.

mydogbites

IS-IT--Management
Jul 3, 2006
23
GB
Hi there

When trying to run the script:

SET oFSO = Wscript.CreateObject("Scripting.FileSystemObject")
strDsk = WshShell.SpecialFolders("Desktop")
' What is the label for the shortcut?
strshortcut = strDsk & "\CompanyShared.lnk"
If Not oFSO.FileExists(strshortcut) Then
SET oUrlLink = WshShell.CreateShortcut(strshortcut)
' What is the path to the shared folder?
oUrlLink.TargetPath = "\\server\CompanyShared\"
oUrlLink.Save
End If


I get an error
Line: 2
Char:5
Error: Wshshell required

Anyone know why?...Not too familar with Vb at all...

Cheers

James
 
Remove the lower case o in SET oFSO on the first line.

SET FSO = Wscript.CreateObject("Scripting.FileSystemObject")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top