Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WSH - shortcuts, setting properties programatically
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
WSH - shortcuts, setting properties programatically
Miscellaneous
Thread ID:
00742107
Message ID:
00742107
Views:
92
The code below will create a shortcut:
WshShell = Createobject("Wscript.shell")
strDesktop = Alltrim(WshShell.SpecialFolders(tcShortCutPlacement))
oMyShortcut = WshShell.CreateShortcut(strDesktop+"\"+tcShortCutName)
oMyShortcut.WindowStyle = 4  && 1=normal 3=Maximized 7=Minimized  4=Normal
oMyShortcut.IconLocation = lcSaveIconDir
oMyShortcut.TargetPath = lcSaveTargetPath
oMyShortcut.WorkingDirectory = lcSaveWorkingDir
oMyShortcut.HotKey = "ALT+CTRL+F"
oMyShortcut.Description = lcSaveDescription
*oMyShortcut.Arguments = "C:\myFile.txt"
I know the name of the shortcut determines the title you see under the icon on the screen and you can rename the 'lnk' file to change that title.

1. Is there a way to name the file while creating the shortcut (different from the target name)?
2. How to change other properties like 'close on exit' while creating the shortcut or programatically?
Dr. Ken A. McGinnis
Healthcare software design
Next
Reply
Map
View

Click here to load this message in the networking platform