You can create a desktop shortcut to a file like this:
Sub MakeDesktopShortcut()
Dim wsh As Object
Dim SC As Object
Dim DesktopPath As String
Set wsh = CreateObject("WScript.Shell")
DesktopPath = wsh.SpecialFolders.Item("Desktop")
Set SC = wsh.CreateShortcut(DesktopPath & "\test.lnk")
SC.TargetPath = "C:\book1.xls"
SC.Hotkey = "CTRL+ALT+Z"
SC.Save
Set wsh = Nothing
End Sub
--
Jim Rech
Excel MVP
| Colo
| Thanks for this it does exactly what I asked. What I
| really wanted to do was create a shortcut on the desktop
| to a file located on C: Any ideas!!
|
| David
| >-----Original Message-----
| >Hi David,
| >
| >You can get it by WSH. Please try the code below.
| >
| > Dim WSHShell, WSH_Folder
| > Set WSHShell = CreateObject("WScript.Shell")
| > Set WSH_Folder = WSHShell.SpecialFolders
| > MsgBox "Your Desktop path would be " & WSH_Folder.Item
| ("Desktop")
| >
| >
| >Colo
| >
| >
| >
| message
| >| >> When I send a self extracting zip file to user it
| >> automatically creates a shortcut on the desktop for user
| >> of Windows 98, but does not for Windows 2000. Is there
| a
| >> way of writing the path for Windows 2000?
| >
| >
| >
| >.
| >