Command Reference

Create Shortcut

Creates a shortcut on the local system.

Action ID: 50
Action Category: Shortcuts

Settings

Locations

Folder

The path to the folder where the shortcut will be created. Usually you will use %SCFolderPath% as the folder. %SCFolderPath% is the start menu folder that the user chooses to install your product's shortcuts to. Other commonly used shortcut folders include %Desktop%, %DesktopNT%, %StartMenu%, or %StartMenuNT%. See the Built-in Variables topic for more information about these variables.

Shortcut description

The description that will appear with the shortcut.

Target file

The full path to the file that this shortcut will "point" to.

Options

Command line arguments

Command line arguments that you want to pass to the Target File.

Working directory

The working directory for the program named in Target File. If you do not specify a working directory, it will be the same as the target file’s directory.

Icon Index

The index of the icon that should be used for this shortcut. The icon will be taken from the file specified in Target File unless an alternate file is specified in External Icon Path. If there is only one icon in the file, or if you want to use the first icon found in the file, enter "0" here.

Use external icon

If checked, you can specify an alternate icon file to use in External Icon Path. If unchecked, the icon will be taken from the Target File. If Target File does not contain an icon the default icon for that file type on the system will be used.

External icon path

The full path to the file that contains the icon you want to use to represent this shortcut. In most cases, this will be exactly the same as the information in Target File, however you are free to specify an alternate icon file. The file must contain a valid Windows .ICO file for this to work.

Run mode

The run mode for the file. Choose Normal, Maximized or Minimized.

Return Values

Value
(%LastErrorNum%)

Simple Message
(%LastErrorMsg%)

Verbose Message
(%LastErrorDetails%)

0 (OK)

 OK

 

1

Failed to create shortcut.

Unable to create local directory.
<<Folder name>>

2

Failed to create shortcut.

The shortcut could not be created by the system.
<<SC Folder\Description>>
<<Target file>>

Example

To create a Shortcut command that places a shortcut to your program on the Windows desktop:

Folder: %Desktop%
Shortcut Description: My Program
Target File: %AppDir%\My Program.exe
Windows NT/2000: Current user group
Command Line Arguments:
Icon Index: 0
Use external icon file: Unchecked
External Icon Path: N/A
Working Directory: %AppDir%
Run Mode: Normal

 

See Also: Alphabetical List of Actions, Categorical List of Actions, On Error tab