Re: How to create a relative shortcut ?
Paul <[email protected]> Wed, 3 Sep 2025 02:21:58 -0400
| Newsgroups | comp.os.ms-windows.programmer.win32,alt.comp.os.windows-xp,alt.windows7.general |
|---|---|
| Organization | A noiseless patient Spider |
| Message-ID | <[email protected]> |
On Tue, 9/2/2025 7:34 PM, J. P. Gilliver wrote:
> On 2025/9/2 10:36:46, R.Wieser wrote:
>> Hello all,
>>
>> I'm trying to create relative shortcuts* (for use on a removable USB
>> harddisk) and can't seem to find out how it works.
>>
>> * the target of the link is relative to the location of the link itself.
>
>
> []
>
> I'm puzzled; don't . and .. work in shortcuts?
>
A shortcut is designed to be copied or moved anywhere.
If the shortcut icon is sitting on the desktop, and
it says ..\programname.exe , that's not going to work.
If the shortcut icon uses an absolute path, then it can be copied
or moved anywhere. If the Original file is moved (somewhere), you
are required to create a new Shortcut (new absolute path).
If you want a file to appear in two places (on the same partition),
then mklink or junction.exe might work. Then, the item is no longer
a shortcut, it's a file, and it looks like a file icon. A hardlink
of a file can be moved to the desktop, but when the program
"works out where it is", as some programs do, it is going to find
that it is not located in the portable folder where all the
DLLs are located.
Right now, the betting money is on a shortcut with an absolute
path inside it. Then, the executable that is loaded, is loaded
from the same folders as where the DLLs are located (right next
to the EXE).
*******
The rules are different for Metro.App , but the newsgroup
list does not hint that this is a requirement.
# A folder full of scum and villainy (mixed types are present)
explorer.exe shell:AppsFolder
# These are two shortcuts, compared.
# I might even find both of these in AppsFolder (on a newer OS).
[Picture]
https://i.postimg.cc/ZR6KdXfH/shortcut-comparison.gif
Paul