Here is the code that will place an item on the desktop
You will need to include the following reference into the project:
Windows Script Host Object Model
'-------
Sub fCreateShortcutOnDesktop()
Dim WSHShell As IWshRuntimeLibrary.IWshShell_Class
Dim WSHShortcut As IWshRuntimeLibrary.IWshShortcut_Class
Dim strFullFilePathName As String
Dim strDesktopPath As String
Dim strFileName As String
Dim strPath As String
' Create a Windows Shell Object
Set WSHShell = New IWshRuntimeLibrary.IWshShell_Class
' Read desktop path using WshSpecialFolders object
strDesktopPath = WSHShell.SpecialFolders.Item("Desktop"
' Create a shortcut object on the desktop
Set WSHShortcut = WSHShell.CreateShortcut(strDesktopPath & "\" & strFileName & ".lnk"
' Set shortcut object properties and save it
With WSHShortcut
.TargetPath = WSHShell.ExpandEnvironmentStrings(strFullFilePathName)
.WorkingDirectory = WSHShell.ExpandEnvironmentStrings(strPath)
.WindowStyle = 4
.Save
End With
fCreateShortcutOnDesktop = 1
Set WSHShell = Nothing
End Sub
'===============
I'll leave the error handling code up to you
To have this done by the PDW, place this subroutine in the Setup1 project of the PDW and call it at the right time.
See my posts in Thread222-246643 or search the Thread for suggestions on modifying the Setup1 project of the PDW or you can search the thread - there have been quite a few posts on the Desktop Shortcuts and PDW issues. Good Luck
-------------- As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.