Hi,

Is there a way that a vbscript can create a desktop shortcut to a shared
folder that exists on a server?

Thanks in Advance,
JeffH

Re: Shortcut to a shared folder by Torgeir

Torgeir
Fri Jul 22 13:52:42 CDT 2005

JeffH wrote:

> Is there a way that a vbscript can create a desktop shortcut
> to a shared folder that exists on a server?
Hi,

Something like this maybe:


'--------------------8<----------------------

sPath = "\\server\share\folder"

sShortcutName = "Shared folder"

Set oShell = CreateObject("WScript.Shell")

' Create shortcut in the All Users Desktop folder
sAllUsersDesktopPath = oShell.SpecialFolders("AllUsersDesktop")

Set oShortCut = oShell.CreateShortcut( _
sAllUsersDesktopPath & "\" & sShortcutName & ".lnk")

oShortCut.TargetPath = sPath
oShortCut.Save

'--------------------8<----------------------


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx