11

When attempting to create a shortcut to another shortcut, Windows XP assigns the target of the original shortcut to the new shortcut. This happens even when I enter the target path manually, and I am left with a copy of the original shortcut. This is not what I want.

How can make a .lnk file point to another .lnk file directly? This form of double indirection would be very useful for managing shortcuts to files that move frequently.

3
  • In windows 7 it just works... It is not the same in XP?
    – soandos
    May 18, 2012 at 2:35
  • 1
    @soandos: It creates a copy of the shortcut instead of creating a shortcut to a shortcut.
    – user541686
    May 18, 2012 at 2:42
  • @soandos If you make a shortcut to a shortcut, the new shortcut will reference the first shortcut's path, not the path of the shortcut file itself. This is the default behavior in Windows XP and 7.
    – iglvzx
    May 18, 2012 at 2:42

7 Answers 7

4

I completely understand the utility of linking to links, and I have been searching for an easy solution as well. The best one I've come up with is to simply use Hardlinks, which point to the shortcut.lnk file. I've tested symbolic links (junctions are just for folders, not files, so they weren't tested) and these do NOT work (they are basically broken files when created, which fail to open).

Hardlinks have a number of advantages and disadvantages. The primary disadvantage is that they are almost impossible to backup easily (you need third party software or scripting to back them up to another dive or even to another location on the same drive). The primary advantage is that they automatically update when you modify the original file, so changing 1 shortcut file (new path/icon) changes all associated hardlinks as well [names for the hardlink, however, are unique, so changing a filename doesn't change the hardlink name and vice versa]. Another feature which is both an advantage and disadvantage of hardlinks is that changing icon/path for the hardlink (changing hardlink data) ALSO changes THE ORIGINAL. This does NOT include 'deleting the link itself' (the link can be deleted as any other file; without deleting the original file itself). This is advantageous because it keeps all the associated links synchronized, but it's disadvantageous in cases where the hardlink is stored in a vulnerable location, and it's data is maliciously modified, or a user error is made in modifying a single link's data. This change will be carried through to all hardlinked partners including the original. Frankly this behavior is generally useful, except in cases where you'd want a 'stable source reference' (1-way modification)

I've tested copying individual hardlinks and folders containing hardlinks, in windows explorer, and the result just creates dissociated shortcuts to the original data (no longer associated hardlinks, and therefore, don't change with modifications to the original link). I find this lack of simple copying extremely annoying, and the primary reason I'd be reluctant to use them extensively, but, if you only have a few for a specific purpose (like synchronizing links from a stable directory, to the desktop/taskbar/startmenu) they may still be a good solution (eventhough, they aren't really portable to other systems, without writing a script to automate their directory building). They DO, however, move around without breaking (you can move them anywhere in the file system, once they are created. You just can't 'copy' them). You can also make as many hardlinks to a single source as you want, but again, you can't easily 'copy-and-paste' you have to make a new hardlink from scratch for each 'copy' you want.

To make a hardlink, just open an elevated command prompt (.cmd opened to system32, or run .cmd as admin) and type:

mklink /H [path and name of Hardlink] [location of original file]

Example:

mklink /H C:\users\you\desktop\hardlink.lnk C:\users\you\location\shortcut.lnk

It's good to designate the hardlink with the filetype it links to (like, here, .lnk, but for notepad documents hardlink.txt, or similar), because it's basically a mirroring of the original file, and windows explorer treats it as if it were the original (again, a useful behavior). I should also directly state that they are ONLY created through command prompt (or 3rd party software which gives a shellExtension or gui for the command). Also, they aren't a 'mirrored copy' of the original, they may show the original object's file sizes, but they intrinsically take up 0bytes of space on the drive; they are actually references stored to the MFT of the drive (which is also the reason they can't be made between 2 different partitions [which is another feature of them worth mentioning; but which is easily overcome with a clever combo of shortcuts, junctions, symlinks, and hardlinks used together in unison])

Frankly, I believe this is exactly what you are looking for, and it is a very useful feature. If you can script well, I'm sure it's not difficult to write a program which simply builds a hardlink directory as you desire (and treat that as a 'backup' or 'portability solution' for other systems). You might also be able to find 3rd party software to make all of these tasks easier, and overcome the intrinsic unwieldiness of working with hardlinks.

2
  • It was totally that option. (still work in Windows Server 2012). Please mark as answered as it exactly answered the question. I use that for "versionning" a software shared through network and launched by 15 users. When I have a new version, i just change the "first" link to point to that new release, and the hardLink is respecting the change. The hardlink is the final link that is residing on my users desktops (10-15 user profiles).
    – Simon
    Aug 26, 2016 at 18:01
  • Either it doesn't work in Windows 10 or I don't understand what a hardlink is. I followed the directions exactly and it said "Hardlink created for ..." but when I right click the hardlink and view Properties it still points to the original file, not the other link. I even ran fc from the command line and it says "no differences encountered" Jun 15, 2018 at 14:28
2

The simplest workaround would be to use Batch files.

If Shortcut.lnk is located in C:\Files\, making a new .bat file with the following single line of code will launch the .lnk file:

"C:\Files\Shortcut.lnk"
5
  • 1
    Yeah I already knew about this (it's the 'answer' mentioned everywhere else on the internet when you search for this), but it doesn't really answer the question...
    – user541686
    May 18, 2012 at 3:09
  • Is there a reason why the "shortcut" to the .lnk file must also be a .lnk file? If this is important or if you have any other requirements, edit your question to include these details. You will get a better answer that way. :)
    – iglvzx
    May 18, 2012 at 4:31
  • Uhm, yes, because that's what I asked in the question... if .bat files were enough then Microsoft wouldn't have made .lnk files...
    – user541686
    May 18, 2012 at 5:16
  • 1
    And FYI, batch files behave nothing like shortcuts the moment you right-click them (or heck, they don't even look like shortcuts even when you look at them).
    – user541686
    May 18, 2012 at 5:16
  • Ok. I went ahead and edited your question to make this requirement more clear.
    – iglvzx
    May 18, 2012 at 5:53
1

One way to make a shortcut to a shortcut in Windows is to use a .url file. In Windows 10, a .url file can be the target of a .lnk file.

Also, a .lnk file can be the target of a .url file.

I succeeded in making a .lnk file that calls a .url file that calls another .lnk file that calls a .exe file.

A URL can be the address of a website, a file on the internet, or a file (or folder) on the same computer.

Here is an example of a URL for a .lnk file on the same computer: file:///C:/My%20Path/My%20Shortcut.lnk

The file path would be this: C:/My Path/My Shortcut.lnk

1

Use the registry editor to make the .lnk extension for shortcuts visible and then change the extension to .ln_ (or similar). Edit the file in a text editor to point to the desired shortcut then change the file extension back to .lnk. I tested on my own and have seen this work.

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Jan 24, 2022 at 1:34
0

It appears you may not be able, unless you create multiple target copies in preferable locations w corresponding shortcuts, appropriately named (disk space intensive). Mycase: I wanted to be able to start an app residing on hard disk via shortcut on desktop, but prevent the random user from doing same by accident. I created multiple target copies of succeeding app versions on USB w shortcuts. In USB absence, links were present on desktop, sorted, but inoperable.

0

In the parent folder to the shortcut-file create a batch file specifying the path of shortcut, simple like that

|
|-dir
  |-shortcut.lnk
  |-shortcutofshortcut.bat
0

It's a bit clunky but CMD and START can do the trick.

%comspec% /c start "lnk" "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\Paint.lnk"

Set the shortcut to Run: Minimized (so you don't see the command window pop-up). And you may want to change the icon to one from the target program. enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .