oShell = CREATEOBJ('Wscript.Shell') cDesktop = oShell.SpecialFolders('Desktop') IF ! FILE(ADDBS(cDesktop)+'HPGAS.LNK') * Shortcut doesn't exist cMyEXELoc = FULLPATH(SYS(16,0)) cMyCurrentDir = FULLPATH(CURDIR()) * So go create the shortcut using the CreateShortcut method - you * know where the desktop is, where the app was started, and where the * executable resides. You can use the default icon for the executable ENDIF>
> >L_Welcome_MsgBox_Message_Text = "This script will create a shortcut to HPGAS on your desktop." >L_Welcome_MsgBox_Title_Text = "Windows Scripting Host Sample" >Call Welcome() > > >Dim WSHShell >Set WSHShell = WScript.CreateObject("WScript.Shell") > > >Dim MyShortcut, MyDesktop, DesktopPath > >' Read desktop path using WshSpecialFolders object >DesktopPath = WSHShell.SpecialFolders("Desktop") > >' Create a shortcut object on the desktop >Set MyShortcut = WSHShell.CreateShortcut(DesktopPath & "\HPGAS.lnk") > >' Set shortcut object properties and save it >MyShortcut.TargetPath = "\HPGAS\hpgas.exe" >MyShortcut.WorkingDirectory = "\HPGAS" >MyShortcut.WindowStyle = 3 >MyShortcut.IconLocation = "\HPGAS\hpgas.exe,0" >MyShortcut.Save > > > > > >WScript.Echo "A shortcut to HPGAS now exists on your Desktop." > >' ******************************************************************************** >' * >' * Welcome >' * >Sub Welcome() > Dim intDoIt > > intDoIt = MsgBox(L_Welcome_MsgBox_Message_Text, _ > vbOKCancel + vbInformation, _ > L_Welcome_MsgBox_Title_Text ) > If intDoIt = vbCancel Then > WScript.Quit > End If >End Sub > >