This example creates the shortcut on the desktop of current user. The caption of this shortcut is "Application for Sales Management".
This shortcut is created for the "SalesMgt.exe" program installed in the SALESMGT subdirectory of "Program Files" directory of current user.
- is using the command line: /P=parameter
- is associated with the Ctrl + Alt + A shortcut
- has the data directory of user (SALESMGT subdirectory) as working directory
// Vista/7 ...: No administrator privilege is required
IF NOT CreateShortCut(shortcutFree, ...
// Free shortcut to specify a directory of the current user
// and not a directory common to all users
"Application for Sales Management", ... // Shortcut caption
], SysDir(srProgramFiles)+["\"]), ...
// Path of application to start (with its command line)
// Shortcut location: directory of the desktop of the user
swsNormal, ... // "Standard" opening
"A", ... // Keyboard shortcut: Ctrl + Alt + A
// Working directory:
// data directory of user (SALESMGT subdirectory)
Error("Failure creating the shortcut in " + SysDir(srDesktop), ErrorInfo())
Info("The shortcut was created")
This page is also available for…