Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making a shortcut
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00522646
Message ID:
00522912
Views:
12
>Thanks George.
>Nevertheless at the programs I have oLnk.TargetPath = cDesktopDir + "\\notepad.lnk" and this don't work.
>How should be the runtime...?
>TIA

Andrews,

Apparently yesterday I hit preview and neglected to send my message.

The following works fine:
* Create the Shell reference
oShell = CREATEOBJECT(“WScript.Shell”)
* Get the current desktop
lcdesktop = oShell.SpecialFolders(“Desktop”)
* Create the link
oLink = oShell.CreateShortcut(lcdesktop + “\Shortcut to Notepad.lnk”)
* Set the target. 
oLink.TargetPath = "C:\Windows\Notepad.exe"
* Set the icon
oLink.IconLocation = "C:\Windows\Notepad.exe"
* Set the working directory
oLink.WorkingDirectory = "C:\Windows"
* Set the window style to maximized
oLink.WindowStyle = 3
* Any optional arguments
oLink.Arguments = “” && None in this case
* Optional hot key
oLink.Hotkey = “” && Any string beginning with Ctrl+Alt+ [ key letter ]
* Save the shortcut
oLink.Save()
The above is paraphrased from the series on the Windows Script Host that Ed Rauh and I wrote for VFUG (www.vfug.org). This is from the second article which appeared last October. The entire series is available on-line at the site.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform