Silently creating Desktop Shortcuts
I have an application that is installed on the network and I need to silently deploy desktop shortcuts to users. The shortcut point back to the app on the network. I tried to copy the shortcut icon in the network drive to "c:\document and settings\all users\desktop"; unfortunately the icon does not copy.
Any suggestions?
Any suggestions?
0 Comments
[ + ] Show comments
Answers (14)
Please log in to answer
Posted by:
dadman53
14 years ago
Posted by:
williasa
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
williasa
14 years ago
Posted by:
williasa
14 years ago
Posted by:
tabbabu
9 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
williasa
14 years ago
Posted by:
dadman53
14 years ago
Try adding this VB script if you want a shortcut on your All Users Desktop. You will need to modify it to point to your startup.exe. This creates a shortcut and doesn't just copy one. You'll need an icon for it as well.
'
' Create a shortcut to C:\Windows\System32\Notepad.exe on the All Users Desktop
'
Const ALL_USERS_DESKTOP = &H19&
Const SYSTEM = &H25&
Const strNotepadExe = "Notepad.exe"
Dim objFSO, objShell, objFolder, objFolderItem, WshShell, objLink
Dim strWindowsDir
Dim strSystemPath, strAllUsersDesktopPath
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
Set WshShell = CreateObject("WScript.Shell")
Set objFolder = objShell.Namespace(SYSTEM)
Set objFolderItem = objFolder.Self
strSystemPath = objFolderItem.Path
Set objFolder = objShell.Namespace(ALL_USERS_DESKTOP)
Set objFolderItem = objFolder.Self
strAllUsersDesktopPath = objFolderItem.Path
strAllUsersDesktopPathIcons = "C:\My_Icons"
'
' If My_Shortcut_to_Notepad shortcut is missing from the strAllUsersDesktopPath folder, recreate it
'
If Not (objFSO.FileExists(strAllUsersDesktopPath & "\My_Shortcut_to_Notepad.lnk")) Then
Call CreateShortcut
End If
WScript.Quit
Sub CreateShortcut
Set objLink = WshShell.CreateShortcut(strAllUsersDesktopPath & "\My_Shortcut_to_Notepad.lnk")
objLink.Description = "This is the description of My Shortcut"
objLink.IconLocation = strAllUsersDesktopPathIcons & "\MyIcon.ico"
objLink.TargetPath = strSystemPath & "\" & strNotepadExe
objLink.WindowStyle = 3
objLink.WorkingDirectory = strSystemPath
objLink.Save
End Sub
'
' Create a shortcut to C:\Windows\System32\Notepad.exe on the All Users Desktop
'
Const ALL_USERS_DESKTOP = &H19&
Const SYSTEM = &H25&
Const strNotepadExe = "Notepad.exe"
Dim objFSO, objShell, objFolder, objFolderItem, WshShell, objLink
Dim strWindowsDir
Dim strSystemPath, strAllUsersDesktopPath
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
Set WshShell = CreateObject("WScript.Shell")
Set objFolder = objShell.Namespace(SYSTEM)
Set objFolderItem = objFolder.Self
strSystemPath = objFolderItem.Path
Set objFolder = objShell.Namespace(ALL_USERS_DESKTOP)
Set objFolderItem = objFolder.Self
strAllUsersDesktopPath = objFolderItem.Path
strAllUsersDesktopPathIcons = "C:\My_Icons"
'
' If My_Shortcut_to_Notepad shortcut is missing from the strAllUsersDesktopPath folder, recreate it
'
If Not (objFSO.FileExists(strAllUsersDesktopPath & "\My_Shortcut_to_Notepad.lnk")) Then
Call CreateShortcut
End If
WScript.Quit
Sub CreateShortcut
Set objLink = WshShell.CreateShortcut(strAllUsersDesktopPath & "\My_Shortcut_to_Notepad.lnk")
objLink.Description = "This is the description of My Shortcut"
objLink.IconLocation = strAllUsersDesktopPathIcons & "\MyIcon.ico"
objLink.TargetPath = strSystemPath & "\" & strNotepadExe
objLink.WindowStyle = 3
objLink.WorkingDirectory = strSystemPath
objLink.Save
End Sub
Posted by:
williasa
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.