If you need to create shortcuts from the command line or within a batch file on a Microsoft Windows system, you can use the free XXMkLink program from Pixelab, Inc.. The company also produces free and commercial versions of XXCLONE, for cloning disk drives, and XXCOPY, a file management utility for copying files.
To use XXMkLink, download the zip file and extract XXMKLINK.EXE from within it to an appropriate directory on a hard drive. You can then run that program without any parameters to see options available for it.
C:\>"\Program Files\Utilities\XXMKLINK" XXMkLink ver 1.00 (c)2005 Copyright Pixelab, Inc. =========== Syntax ======================= xxmklink spath opath [ arg [ wdir [ desc [ mode [ icon[:n] ]]]]] [switches...] where spath path of the shortcut (.lnk added as needed) opath path of the object represented by the shortcut arg argument string (use quotes with space, see below) wdir path of the working directory (for "Start in") desc description string (shown in Shosrtcut's Properties) mode display mode (1:Normal [default], 3:Maximized, 7:Minimized) icon[:n] icon file [with optional icon index value n] Currently, the following switches are supported /p prompts before action /q no output when successful (quiet) Note: Switches (whose first character is always slash) can be placed in any position of the command argument. A string that starts with a slash as a non-switch argument must be surrounded by a pair of double-quotes ("). It is recommended that the XXMKLINK's switches be placed before or after the non-switch arguments for clarity. Make sure that each element is surrounded by a pair of double-quotes (") if embeded space is present. The third field (arg) is for the argument string for the object (typically a program that requires command arguments) that must be entered as one string here, even if it has many parts that are separated by spaces and possibly with double-quote characters. When double-quoted string has an embedded double-quote, add a backslash in front of each embedded double-qoute. Use an empty string (two consecutive double-quotes) as a place holder since this command syntax is sensitive to the order of the field, optional switches cannot alter the pre-determined order as defined by the program. When an invalid display mode is specified (not 1, 3 nor 7), the default (Normal Window) value will be used. When the icon specifier does not point to an existing file, the icon field will be ignored. E.g. mklink "c:\Program Files\mydir\My Shortcut.lnk" c:\boot.ini (At least two arguments are always needed.) mklink c:\myauto c:\autoexec.bat "/q" . "I say \"Hello.\"" "desc..." (In this example, the third argument string, "/q" was entered as a quoted string. If it were without the quotation marks, it would be treated as the xxmklink switch, /q, not the argment string for the object program.)
At a minimum, the following two arguments are needed to the program to create a shortcut:
spath - path and filename for the shortcut; if you don't add a .lnk at the end of spath, one will be added automatically, since all shortcuts must have a .lnk extension.
opath - path and filename of the object represented by the shortcut, i.e. the location and name for the file or program for which you are creating the shortcut.
E.g., suppose I wanted to create a shortcut on the desktop for the account
under which I'm currently logged into the system that points to the WinSCP
program, winscp.exe
. I could use the following command, if
the xxmklink.exe
file is in
C:\Program Files\Utilities
and the winscp.exe
program is in c:\program files (x86)\network\SSH\WinSCP\
. If I
was logged into the JDoe account, the
environment variable %USERPROFILE%
would equate to
C:\Users\JDoe
.
C:\>"\Program Files\Utilities\xxmklink" %USERPROFILE%\Desktop\WinScp.lnk "c:\program files (x86)\network\SSH\WinSCP\winscp.exe" XXMkLink ver 1.00 (c)2005 Copyright Pixelab, Inc. The shortut created as follows Shortcut path: C:\Users\JDoe\Desktop\WinScp.lnk Target object: c:\program files (x86)\network\SSH\WinSCP\winscp.exe Arguments; Working Directory: Description: Display Mode: Normal Window (1) Icon file:
If I then hit the Windows key and the "D" key simultaneously, I would then see the WinSCP shortcut on the desktop.
Security information for current version of XXMkLink, which is 1.00
File name: | xxmklink.zip |
SHA256: | 2fe7b3b9c73e6467ba8d4e5157491a4409b44eab359d0320a3cba1e2bbec08ca |
MD5: | 8f67bd67f4bd752837276caff870e474 |
VirusTotal dection ratio: | 0/54 |
Analysis date: | 2014-06-28 |