- NAME
- tlink32 - binding to Windows
IShell Shortcut interface.
- SYNOPSIS
- package require tlink32 ?1.1?
-
- win32::link get
filename
- win32::link set
filename ?options?
- win32::link recent
filename ?options?
- win32::link path
?-create ?-common pathname
- DESCRIPTION
- SEE ALSO
tlink32 - binding to Windows IShell Shortcut
interface.
package require tlink32 ?1.1?
win32::link get
filename
win32::link set
filename ?options?
win32::link recent
filename
win32::link path
?-create ?-common pathname
This is a very simple extension that provides a single command
that can create, inspect, and modify Windows Shortcuts. It also
queries Windows for the location of common paths, such
as desktop or programs
- win32::link get
filename
- win32::link set filename ?options?
- The get sub-command returns the various
parameters that make up the shortcut definition (see
below). It will return an error if the filename specified
is not a valid shortcut or does not exist. The set
sub-command creates the specified filename, if it does
not already exists, and additionally modified the
attributes of the shortcut as specfied in the options
below. The recent sub-command creates a
shortcut in the recent documents directory and in the start
menu documents list.Note: the Win32 interface will
allow you to create shortcuts with any valid filename,
but the Windows explorer will only understand them if
they end in the extension ".lnk".
The available options are: -
- -path pathName
- The pathname that this shortcut points to. (default:
empty)
- -args string
- The arguments to pass to the program specfied in -path
option. (default: empty)
- -cwd pathName
- The directory to start the specified program in. (default:
current directory)
- -desc string
- A human readable description of this shortcut. (default:
empty)
- -icon pathName
- The pathname of an icon file, or executable/dll that
contains icon resources. (default:
empty)
- -index number
- The index of the icon in the file specified in -icon
(if an executable/dll). (default: 0)
- -show number
- The numeric mask for controlling how the window
appears then the program is executed - consult
standard Win32 Api documentation for more details. (default:
1)
- -hotkey number
- The numeric mask for controlling hotkey access to
this shortcut - consult standard Win32 Api
documentation for more details. (default:
0)
- win32::link recent filename|-clear
- Add the file to the list of recent documents, to the Start menu
documents directory, and to the recent documents directory. If
-clear is given, clear the recent document list.
- win32::link path
?-create ?-common pathname|id
- The path sub-command queries the system for
the location of various named paths. If the named path is not
available on the system, the empty string is returned. Use the
path command without any path to get a list of available names.
Instead of name, you can use the CSIDL number (search MSDN for
a list of available numbers).
The -create option creates the path if it
does not already exist. The -common option
returns the path for all users, instead of the current user. This
option is ignored if no common path is available. Some paths
are virtual and should not be written to by your program.
- admintools
-
A directory where administrative tools are kept. The context of this constant (All Users or Current user) depends on the SetShellVarContext setting. The default is the current user.
Windows 2000, ME and above.
- appdata*
-
The application data directory. Detection of the current user path requires
Internet Explorer 4 and above. Detection of the common path requires
Internet Explorer 5 and above.
Needs at least Internet Explorer 4 and Active Desktop.
- appdatalocal
-
Repository for nonroaming application data. Typically
C:\Documents and Settings\username\Local Settings\Application Data.
Needs at least Internet Explorer 4 and Active Desktop.
- cdburnarea
-
A directory where files awaiting to be burned to CD are stored.
Windows XP and above.
- commonfiles
-
The common files directory. This is a directory for components that are shared across applications (usually C:\Program Files\Common Files but detected at runtime).
- controls
-
Control panel icons. For reference only, not for installation.
- cookies
-
Internet Explorer's cookies directory.
Needs at least Internet Explorer 4 and Active Desktop.
- desktop*
-
The windows desktop directory (usually C:\windows\desktop but detected at runtime).
- documents*
-
The documents directory. A typical path for the current user is C:\Documents and Settings\Foo\My Documents.
Needs at least Internet Explorer 4 and Active Desktop.
- drives
-
The My Computer virtual folder.
- favorites*
-
The directory that contains shortcuts to the user's favorite websites, documents, etc.
Needs at least Internet Explorer 4 and Active Desktop.
- fonts
-
The system fonts directory.
- history
-
Internet Explorer's history directory.
Needs at least Internet Explorer 4 and Active Desktop.
- internet
-
A virtual folder representing the internet
- internetcache
-
Internet Explorer's temporary internet files directory.
Needs at least Internet Explorer 4 and Active Desktop.
- music*
-
The music files directory.
Windows XP, ME and above.
- nethood
-
The directory that contains link objects that may exist in the My Network Places/Network Neighborhood folder.
Needs at least Internet Explorer 4 and Active Desktop.
- pictures*
-
The picture files directory.
Windows 2000, XP, ME and above.
- printhood
-
The directory that contains link objects that may exist in the Printers folder.
Not available on Windows 95 and Windows 98.
- printers
-
The installed printers virtual folder.
- profile
-
The user's profile directory. A typical path is C:\Documents and Settings\Foo.
Windows 2000 and above.
- programfiles
-
The program files directory (usually C:\Program Files but detected at runtime).
- programsmenu*
-
The Start menu Programs folder.
- recent
-
Links to recently used documents. Use win32::link recent to add items.
- resources
-
The resources directory that stores themes and other Windows resources (usually C:\Windows\Resources but detected at runtime).
Windows XP and above.
- resourceslocal
-
The localized resources directory that stores themes and other Windows resources (usually C:\Windows\Resources\1033 but detected at runtime).
Windows XP and above.
- sendto
-
The directory that contains Send To menu shortcut items.
- startmenu*
-
The start menu folder where you want to add top level start menu items.
- system
-
The windows system directory (usually C:\windows\system or C:\winnt\system32 but detected at runtime)
- startupmenu*
-
The Start menu Programs Startup folder.
- temp
-
The system temporary directory (usually C:\windows\temp but detected at runtime).
- templates*
-
The document templates directory.
- videos*
-
The video files directory.
Windows XP, ME and above.
- virtualdesktop
-
The virtual desktop. Use desktop to install desktop shortcuts.
- windows
-
The windows directory (usually C:\windows or C:\winnt but detected at runtime)
Items marked with * are available as common
as well as user items.
Note: the -create may not
work on Windows 95, 98 or NT --- if this is important to you,
you can modify the tlink source to test for the existence of
the returned directory and create it if it doesn't exist.
Windows IShell API
Windows Shell Programmer's Guide, CSIDL descriptions
Copyright © 1996-1999 Sensus Consulting Ltd.
Support for named paths added by Paul Kienzle, 2004-02-17