Windows: shortcuts with relative target paths?

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
474
Points
83
Website
orbit.medphys.ucl.ac.uk
This is a question for Windows gurus:
Is it possible to specify relative target paths for windows shortcuts (similar to Unix symbolic links with relative paths)? This is such an obvious functionality that I am sure it must be possible, but I have yet to find out how to do it. Whenever I try to enter a relative path in the shortcut target field, windows replaces it by the absolute path unasked.

My problem is this: I want to create a shortcut in a directory that points to a target in a subdirectory (yes, I am talking about orbiter_ng ;)). I want the shortcut to remain valid when the whole directory tree is moved or the root directory renamed. How do I do it?
 
I think this is impossible because Windows does too much, as you found out. With the right NTFS tools, you can even have direct links under windows, the damn windows explorer just does not use this feature of NTFS.
 
My problem is this: I want to create a shortcut in a directory that points to a target in a subdirectory (yes, I am talking about orbiter_ng ;)). I want the shortcut to remain valid when the whole directory tree is moved or the root directory renamed. How do I do it?

I don't think it's possible, even with hand-made lnk file.
But why use an *.lnk shortcut? A batch file does the job just fine:

orbiter_ng.bat:
Code:
@echo off
call modules\server\orbiter.exe
 
Alright, the batch file method seems to work - thanks!
Except - is there a way to prevent windows from opening the extraneous shell window?

Edit: I came up with a slight improvement to your script:
Code:
start modules\server\orbiter.exe
exit
This will still flicker the shell window into existence briefly, but at least it doesn't linger, so it's a bit less annoying.

Since I am already at it, here is the next question:

All the mucking about with shortcuts and batch files could be avoided if I could simply place the server executable into the main orbiter directory with a different name, e.g. orbiter_ng.exe.

Problem is, all plugin DLLs then get confused, because they are looking for orbiter.exe. It seems as if the name of the executable is hard-coded into the symbol list of the export libraries (orbiter.lib and orbitersdk.lib). Why should that be? Is there a way to allow the DLLs to link to an executable with different name?


Well, I have finally written a little launcher application for orbiter_ng. Why trust windows if you can do it yourself? :dry:
 
Back
Top