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