Code: Select all
' GLB 05/11/09*2:42PM
'usage: Pass [Shortcut_Name],[Directory_Path],[Application_Name]+[Extension],[ICON_Path]+[ICON_Extension] with each Item in Quotes if there are spaces
'like \Program Files (x86)\ would be "\Program Files (x86)\".
On Error Resume Next
If WScript.Arguments.Count >= 1 Then
Call CreateShortcuts(WScript.Arguments(0), WScript.Arguments(1), WScript.Arguments(2), WScript.Arguments(3))
End If
Sub CreateShortcuts (scName, scDir, scPgm, scIco)
Set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\" & scName & ".lnk")
WScript.Echo (strDesktop + "\" + scName + ".lnk")
oShellLink.TargetPath = scDir & scPgm
oShellLink.WindowStyle = 1
oShellLink.Hotkey = ""
oShellLink.IconLocation = scDir & scIco & ", 0"
oShellLink.Description = scName
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save
End Sub