Re: How to create a relative shortcut ?

Schugo <[email protected]> Wed, 3 Sep 2025 22:52:51 +0200
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 03.09.2025 21:22, R.Wieser wrote:
> Udo,
> 
>> Real links are not an option?
>> https://learn.microsoft.com/en-us/windows/win32/fileio/hard-links-and-junctions
> 
> The first one doesn't work with FAT 32 (the default for thumbdrives), and 
> the second has the same problem a shortcut has : using full pathnames.

A solution without programming:

https://optimumx.com/download/Shortcut.zip

Z: is a USB drive
make a link to Z:\test\test2\dxcpl.exe

shortcut32 /a:c /f:test.lnk /t:.\test\test2\dxcpl.exe /w:.\test\test2

- click on the test.lnk,
- file is not found, click search button, point to the .exe
- .exe launches, .lnk is updated in this moment with the correct relative
  paths
- change the drive letter to G:
- click on the G:\test.lnk, .exe launches correctly

ciao...