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 programming against the IShellLink interface ( https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-ishelllinka) ,
which suggests a relative path is possible (SetRelativePath), but I'm not able to get it to work or find code explaining how to do it.
I did find this : https://devblogs.microsoft.com/oldnewthing/20171019-00/?p=97247 , but I'm
not even sure if that is what I'm after ... :-|
Question: does someone have an example to what I'm supposed to do to make it happen ?
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 programming against the IShellLink interface ( https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-ishelllinka) ,
which suggests a relative path is possible (SetRelativePath), but I'm not able to get it to work or find code explaining how to do it.
I did find this : https://devblogs.microsoft.com/oldnewthing/20171019-00/?p=97247 , but I'm
not even sure if that is what I'm after ... :-|
Question: does someone have an example to what I'm supposed to do to make it happen ?
Not really, but as a workaround:[snip]
use a .bat instead:
or 2nd idea: a little app launcher .exe with only a listbox
with a list of apps and a start button, then ShellEx with
relative path.
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?
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 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.
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.
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 hardlinkSo far, I've (AFAIK) managed to not get involved with metro "app.s";
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
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 714 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 141:18:09 |
| Calls: | 12,087 |
| Files: | 14,998 |
| Messages: | 6,517,442 |