Shortcut Properties

The properties of a shortcut object can be accessed as:

$link->{'property'}

For example, assuming that you have created a shortcut object with:

$link=new Win32::Shortcut(  );

you can see its description with:

print $link->{'Description'};

You can, of course, also set it like this:

$link->{'Description'}="This is a description";

The shortcut properties also have corresponding methods that can also set or read their values.

The properties of a shortcut reflect the content of the Shortcut Properties dialog box, which can be obtained by right-clicking on a shortcut file in the Windows 95 (or NT 4.0) Explorer and choosing “Properties.” Shortcut properties are:

Arguments

The arguments associated with the shell link object. They are passed to the targeted program (see Path) when it gets executed. In fact, joined with Path, this parameter forms the “Target” field of a Shortcut Properties dialog box.

Description

An optional description given to the shortcut. Not implemented in Shortcut Properties dialog box.

File

The filename of the shortcut file opened with Load and/or the filename under which the shortcut will be saved with Save (if the fileargument is not specified).

Hotkey

The hotkey associated with the shortcut, in the form of a two-byte number, of which the first byte identifies the modifiers (Ctrl, Alt, Shift, etc.), and the second is the ASCII code of the character key. Corresponds to the “Shortcut key” field of a Shortcut Properties dialog box.

IconLocation

The file that contains ...

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.