Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the native way to create a shortcut (.LNK file) from the Windows XP command line? [closed]

EDIT!

Sorry to change the question on everyone, but I am really just asking:

How do I create a shortcut (.LNK) file from the command line with as little outside help as possible? I really don't want to run a VBscript or to download a program to do it for me. Is it really that hard?

Thanks to everyone who provided exceptional answers when I didn't really know what I was asking yet!


The original title of this question was:

Windows equivalent of Unix ln -s for creating shortcuts from the command line?

The original question text of this question was:

On *nix, I can create a symbolic link to a file very easily from the command line using ln -s.

How do I natively create a shortcut to a file using the Windows XP command prompt?

Note: This is not the approach I want to take. I want to do it the way Windows does it. I want to do it the right way.

like image 495
eleven81 Avatar asked Feb 12 '09 16:02

eleven81


People also ask

How do I create an LNK file?

doc file in a folder and select Copy and then right-click the Desktop and selectPaste Shortcut, Windows creates a . lnk file that points to the .

What is a shortcut LNK file?

An LNK file is a Windows Shortcut that serves as a pointer to open a file, folder, or application. LNK files are based on the Shell Link binary file format, which holds information used to access another data object.

What is the default program for .LNK files?

Last Updated: 07/01/2022 Default Programs. lnk, also known as a Windows File Shortcut file, was created by Microsoft for the development of Windows 8.1. LNK files fall under under the Shortcut (Windows File Shortcut) file type category.


2 Answers

Windows XP and later has the fsutil command, which can create "hardlinks" to files.

See:

  • MSDN: Hard Links and Junctions
  • JSI Tip 10153: The Windows XP FSUTIL.EXE HARDLINK CREATE command
like image 74
Patrick Cuff Avatar answered Sep 29 '22 01:09

Patrick Cuff


XP doesn't have symlinks. On Vista, the command is mklink. Shortcuts are not symlinks.

like image 35
Ana Betts Avatar answered Sep 29 '22 03:09

Ana Betts