Is there any way to build an installation package using the Package & Deployment Wizard that comes with VB6 to place a shortcut on the All Users desktop instead of in the logged in user's Start menu on an NT system?
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 for suggestions on modifying the Setup1 project of the PDW
Good Luck
------------
Select * from Users where Clue > 0
0 rows returned
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.