Shortcut extension for TCL on NT 4.0 and Windows 95

This extension allows you to manipulate shortcuts on NT 4.0 and Windows 95. The extension can create, modify, and get information from shortcuts.  You'll need to execute

load shortcut.dll

in the TCL interpreter to make these functions available.

Command set

shortcut option arguments

shortcut dialog
shortcut nodialog

shortcut dialog and shortcut nodialog control whether or not dialog boxes are displayed during the process of shortcut manipulation.

shortcut create linkPath [-objectPath objectPath] [-description description] [-workingDirectory dir] [-icon path index] [-arguments args]
shortcut modify linkPath [-objectPath objectPath] [-description description] [-workingDirectory dir] [-icon path index] [-arguments args]

shortcut create and shortcut modify allow you to create and modify shortcuts. The only required parameter for each of these is the linkPath. This means you can create a shortcut with no target, which probably isn't useful. The icon of the shortcut will default to the icon of the target item if not specified. You can return the icon to the default by specifying the an empty string ({}) for the path and 0 for the index.

shortcut getinfo linkPath
shortcut getinfounc linkPath

shortcut getinfo and shortcut getinfounc return a list containing these elements:
objectPath
args
description
workingDirectory
path (icon)
index (icon)

shortcut getinfo returns a normal 8.3 for objectPath, where shortcut getinfounc returns a UNC for objectPath if one is applicable.

Arguments:

Option Explanation
linkPath The path to the shortcut file (extension is .lnk)
objectPath The target of the link
description Shortcut description
workingDirectory Working (startup) directory for the target of the shortcut
path index (icon) Specifies the path to a file and the index of the icon in that file to use for the shortcut
args Arguments passed to the target of the shortcut when started.