Command Reference

Remove Shortcut

Removes a shortcut from the local system.

Action ID: 51
Action Category: Shortcuts

Settings

Locations

Folder

The path of the folder containing the shortcut to remove. 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%, and %StartMenuNT%. See the Built-in Variables topic for more information about these variables.

Shortcut description

The description of the shortcut that you want to remove.

Return Values

Value
(%LastErrorNum%)

Simple Message
(%LastErrorMsg%)

Verbose Message
(%LastErrorDetails%)

0 (OK)

 OK

 

1

Failed to remove shortcut.

Could not delete file(s).
<<SC Folder\Description.lnk>>

Example

In this example, we will remove the shortcut to "My Program" from the Windows desktop.

Note: %Desktop% is a built-in variable.

Folder: %Desktop%
Shortcut Description: My Program

 

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