@SCINFO — Returns values from a shortcut file.

Syntax:
%@SCINFO[filename,field]

filenamethe file to examine
fieldwhich field to return:
0the target filename or object name (default)
1the command-line arguments
2the working directory
3the descriptive comment
4the hotkey
5the startup window mode
6the icon filename
7the icon index
8the UAC level
32the width of the console screen buffer
33the height of the console screen buffer
34the width of the visible window
35the height of the visible window
36the console font name
37the font width in pixels (may be 0 for TrueType fonts)
38the font height in pixels
39the font weight: 400 = normal, 700 = bold
40the cursor size: 25 = small, 100 = large
41QuickEdit mode: 0 = disabled, 1 = enabled
42auto position window: 0 = disabled, 1 = enabled
43insert mode: 0 = overstrike, 1 = insert
44default console colors as hex, e.g. 0x0007 = white on black
45console popup colors as hex, e.g. 0x00F5 = magenta on bright white
46console window position (if auto position is disabled) as x,y

†   Console property. If the shortcut does not contain a console properties block, @SCINFO will return -1.

The filename is required. Quote it if is contains commas or other special characters. Wildcards are not allowed, but directory aliases are supported.

If field is 0 or absent, @SCINFO will attempt to return the shortcut’s target. The return value will be quoted. It may be empty if the target is an object which the plugin doesn’t recognize.

A field of 1, 2, or 3 returns the shortcut’s command-line arguments, working directory, or description, respectively. These return values are all quoted; any of them may return an empty string if the respective field is not defined in the shortcut.

A field of 4 returns the shortcut’s hotkey. This value is not quoted. It will return None if the shortcut has no hotkey defined.

A field of 5 returns the shortcut’s startup window mode. This value is not quoted; possible values are Normal, Maximized, and Minimized.

Values of 6 and 7 return the shortcut’s icon filename and offset, respectively. The filename will be quoted. If there is no icon, the filename will be empty and the index will be 0.

If field is 8, the shortcut’s UAC level will be returned; possible values are Normal and Elevated. (Under Windows XP and earlier, the value is always Normal.) The returned string is not quoted.


If you add 256 to the field number, the return string will not be automatically quoted. If you add 512, the return string will be escapified.

rem  Read info from a shortcut file:
set shortcut="%userprofile\desktop\test.lnk"
set target=%@scinfo[%shortcut,0]
set args=%@scinfo[%shortcut,1]
set dir=%@scinfo[%shortcut,2]


See also: the MKSC command, which creates, modifies, or displays shortcut files.