Shortcut (computing)
In
Shortcuts are typically implemented as a small file containing a target
.desktop
files which provide additional configuration details.
Implementations
Microsoft Windows
Filename extension | .lnk , .url , .cda |
---|---|
Internet media type | application/x-ms-shortcut |
Developed by | Microsoft Corporation |
Type of format | file shortcut |
File shortcuts (also known as shell links) were introduced in Windows 95.[1] Microsoft Windows uses .lnk
as the filename extension for shortcuts to local files, and .URL
for shortcuts to remote files, like web pages. Commonly referred to as "shortcuts" or "link files", both are displayed with a curled arrow overlay icon by default, and no filename extension. (The extension remains hidden in Windows Explorer even when "Hide extensions for known file types" is unchecked in File Type options, because it is controlled by the NeverShowExt
option in HKEY_CLASSES_ROOT\lnkfile
in the Registry. The IsShortcut
option causes the arrow to be displayed.) Shortcut files can be used to launch programs in minimized or maximized window states if the program supports it.
Microsoft Windows .lnk
files operate as
.lnk
files cannot be used in place of the file except in Windows Explorer, and have other uses in Windows Explorer in addition to use as a shortcut to a local file (or GUID). These files also begin with "L".
Although shortcuts, when created, point to specific files or folders, they may break if the target is moved to another location. When a shortcut file that points to a nonexistent target is opened, Explorer will attempt to repair the shortcut. Windows 9x-based versions of Windows use a simple search algorithm to fix broken shortcuts.[1] On Windows NT-based operating systems and the NTFS file system, the target object's unique identifier is stored in the shortcut file and Windows can use the Distributed Link Tracking service for tracking the targets of shortcuts, so that the shortcut may be silently updated if the target moves to another hard drive.[2] Windows Installer, introduced in Windows 2000, added another special type of shortcuts called "Advertised Shortcuts."
File shortcuts in Windows can store a
Generally, the effect of double-clicking a shortcut is intended to be the same as double-clicking the application or document to which it refers, but Windows shortcuts contain separate properties for the target file and the "Start In" directory. If the latter parameter is not entered, attempting to use the shortcut for some programs may generate "missing DLL" errors not present when the application is accessed directly.[3]
File system links can also be created on Windows systems (Vista and up). They serve a similar function, although they are a feature of the file system. Windows shortcuts are files and work independently of the file system, through Explorer.[4]
Beginning with
Although Windows does not provide convenient tools to create it, Explorer supports a "folder link" or "shell link folder": a folder with the system attribute set, containing a hidden "desktop.ini" (folder customization) file which tells Explorer to look in that same folder for a "target.lnk" shortcut file pointing to another folder. When viewed in Explorer, the shell link folder then appears to have the contents of the target folder in it—that is, the customized folder becomes the effective shortcut.[6] This technique is used by Microsoft Windows for items like WebDAV folders. The advent of file system links in Windows Vista and up has made shell link folders less useful.
There is another type of file that is similar to a .lnk
file, but has the extension .cda
. This is used to reference a track (song) on a CD (in standard CDDA / RedBook format).
Unix
Filename extension | .desktop |
---|---|
Internet media type | text/plain |
Developed by | freedesktop.org |
Type of format | file shortcut |
Extended from | INI file |
On Unix-like systems such as Linux and BSD, a simple pointer to a target file or directory is implemented in the operating system as a symbolic link.
When the target is a program, many graphical user interfaces support .desktop
and .directory
files. The format of these plain text files follows the 'desktop entry' specification by freedesktop.org, and besides the location of the program they can provide an icon, a tooltip and other details.[7]
Mac
Macintosh does not have extensions for shortcuts. A file type called "alias" was introduced in Macintosh
In addition,
.webloc
, for storing Internet URLs.
History
To execute an
See also
- NTFS symbolic link
- Hard link
- Program information file
References
- ^ TechNet Magazine. Microsoft. Archived from the originalon 12 October 2009. Retrieved 14 April 2019.
- Microsoft Corporation. 28 February 2007. Archived from the originalon 9 April 2008. Retrieved 14 April 2019.
- ^ Cheng, Chieh (19 April 2008). "Dawn of War - Dark Crusade: Error Loading Module". GearHack. Retrieved 14 April 2019.
- TechNet Magazine. Microsoft. Archived from the originalon 4 July 2009. Retrieved 14 April 2019.
- MSDN. Microsoft. Archived from the originalon 13 January 2015. Retrieved 14 April 2019.
- CBS Interactive. Retrieved 14 April 2019.
- ^ "Desktop Entry Specification". freedesktop.org. 27 April 2020. Retrieved 2023-10-27.
External links
Windows LNK
- "MS-SHLLINK: Shell Link (.LNK) Binary File Format" from Microsoft
- Windows Shortcut File format specification of Joachim Metz, combining Microsoft specification and observations across Windows versions – for example, some aspects of Windows 95 behavior are not mentioned in MS-SHELLINK
- IShellLink interface for accessing .lnk files in the Windows API
- "Shellify" Archived 2010-07-30 at the Wayback Machine Shellify is a 100% managed .NET implementation of the Microsoft Shell Link (.LNK) Binary File Format for accessing .lnk files without the Windows API
- Win32::Shortcut - Perl Module to deal with Windows Shortcuts Perl library
.desktop files
- "Howto desktop file", a guide for .desktop files