shortcut

create an explorer shortcut file 

Command


SYNOPSIS

shortcut [-f dest-file] [-a arglist] [-w workdir] [-s show-keyword] [-i iconpath[,iconindex]] [-d description] [-D] shortcut-file

shortcut -p [-D] shortcut-file


DESCRIPTION

The shortcut command lets you create or edit link files (.lnk). Link files can be double clicked to run an application from your desktop or from a program group.

The final argument (shortcut-file) to shortcut specifies the link file name. For example, the command line

shortcut -f c:/mksnt/sh.exe -a -L shellink.lnk

would create a file named shellink.lnk which runs the KornShell with the -L option whenever it is double clicked. You must name your shortcut file with a .lnk suffix or your system cannot interpret the file type properly.

Options

-a arglist 

defines any arguments to the executable file specified with the -f dest-file option.

-d description 

specifies descriptive text to be embedded in the link file. description is only displayed when you use the -p option to print the contents of the link file. If description includes space, the text should be enclosed in double quotes (").

-D shortcut-file 

specifies the shortcut-file is on the desktop.

-f dest-file 

specifies the full path and file name of the executable file to be run when the link file is double clicked.

-i iconpath[,iconindex

specifies the icon to be displayed for the link file. If the specified icon contains multiple images, determine which image is to be displayed by entering the appropriate number for iconindex.

-p 

displays the contents of the specified shortcut file.

-s show-keyword 

specifies how the executable is displayed when invoked. show-keyword can be one of the following:

SW_SHOW             starts the program in standard mode
SW_SHOWMAXIMIZED    starts the program in full screen mode
SW_SHOWMINIMIZED    starts the program minimized
SW_SHOWMINNOACTIVE  displays the program as an icon but does not start it

When this option is not specified, shortcut defaults to SW_SHOW.

-w workdir 

specifies the working directory in which the program is started.


EXAMPLE

The following command line would create a shortcut for the MKS KornShell, place the KornShell icon on your desktop, and open the program in full screen mode:

shortcut -f c:/mksnt/sh.exe -s SW_SHOWMAXIMIZED -D shell.lnk

ENVIRONMENT VARIABLES

TK_UNIX_FILESYSTEM 

When this variable is set, the Enhanced UNIX Compatibility Mode is on and the virtual file system is in use.

When the Enhanced UNIX Compatibility Mode is on, you may specify virtual file system path names as the shortcut-file and as the arguments to the -f, -i, and -w options. However, all path names stored in the link file are stored as Windows path names (and displayed as such by -p) regardless of whether Enhanced UNIX Compatibility Mode is on or off.

For details on the Enhanced UNIX Compatibility Mode and the virtual file system, see the EUCM reference page.


DIAGNOSTICS

Possible exit status values are:

0 

Successful completion.

>0 

An error occurred.


PORTABILITY

Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022.


AVAILABILITY

PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


PTC MKS Toolkit 10.4 Documentation Build 39.