[TC 9 All] cant launch the programs in Junction/Link Path

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

thomasmo
Junior Member
Junior Member
Posts: 81
Joined: 2013-11-04, 01:31 UTC

[TC 9 All] cant launch the programs in Junction/Link Path

Post by *thomasmo »

Example:
a exe file in the symbol link path

d:\program file\apps\exam\exam.exe

in path "d:\program file\tool" make a relative path link

mklink /D apps ..\apps

and the exe file path in "d:\program file\tools\apps\exam\exam.exe" could not be launch

in the windows's explorer, it can be run.

if the path is made with "/J" to be a absolute path, it also can be run.

it's not all program has this problem.


the problem has this results

1. double click exe file, cant

2. run the exe with absolute path in the exe's relative link path, cant

3. run the exe with absolute path in the other real path, can

4. run the exe in bar with path in itself, cant
Last edited by thomasmo on 2016-08-04, 22:54 UTC, edited 2 times in total.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Confirmed. I get 'Access denied' error message.
thomasmo
Junior Member
Junior Member
Posts: 81
Joined: 2013-11-04, 01:31 UTC

Post by *thomasmo »

MVV wrote:Confirmed. I get 'Access denied' error message.
aha! but when I run TC with Admin and close windows alert, it also happen
User avatar
petermad
Power Member
Power Member
Posts: 16113
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2thomasmo
in path "d:\program file\tool" make a relative path link

mklink /D exam ..\exam
Don't you mean:
mklink /D exam ..\apps\exam

Otherwise I don't see how the exam link could point at d:\program file\apps\exam\
it's not all program has this problem.
I tried (after using mklink /D exam ..apps\exam) with a copy of totalcmd64.exe renamed to exam.exe - it works fine - can you give an example of an exe (common to most windows users), where it doesn' work.

I am not quite sure whether d:\program file\apps\exam\exam.exe also has to be a symlink to an exam.exe somewhere else, but even if I try that, it still works for me. Or is d:\program file\apps\exam\ a symlink in your example?
Last edited by petermad on 2016-08-04, 15:08 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

petermad,
Try this: d:\program file\apps\exam\tools => ..\exam === d:\program file\apps\exam
I've tested with this: D:\test\test1\test\ => ..\test === D:\test\test\
The point is symlink with relative path ..\exam.
User avatar
petermad
Power Member
Power Member
Posts: 16113
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2MVV
If I while in d:\program file\apps\exam\tools
perform: mklink /D exam ..\exam
I get: symbolic link created for exam <<===>> ..\exam
I then have a SymlinkD folder link named exam in d:\program file\apps\exam\tools and if I double click on that link I just get an error sound - same thing in Explorer.

If I while in D:\test\test1\test
perform: mklink /D test ..\test
I get: symbolic link created for test <<===>> ..\test
I then have a SymlinkD folder link named test in D:\test\test1\test and if I double click on that I go to d:\test\test1\test\test that has a symlink folder named test, and if i Doubleclick on that I go to d:\test\test1\test\test\test with a symlink folder named test - etc. etc. etc. - same thing in Explorer.

To thomasmo's example:
If I while in d:\program file\tools
perform: mklink /D exam ..\exam
I get: symbolic link created for exam <<===>> ..\exam
I then have a SymlinkD folder link named exam in d:\program file\tool and if I double click on that link I just get an error sound - same thing in Explorer.

This makes sense, since there is no exam folder in the parent folder of d:\program file\tool (i.e. d:\program file) and that is why I suggest that it should be: mklink /D exam ..\apps\exam since there IS a folder path named apps\exam in the parent folder of d:\program file\tool.

It is also a little confusing that thomasmo writes:
in path "d:\program file\tool" make a relative path link
and later writes:
and the exe file path in "d:\program file\tools\exam\exam.exe" could not be launch
Is it tool or tools ?
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

petermad,
You can specify full path to symlink, it doesn't matter, you only should use relative target path.
You're right, I've messed it up a bit too with thomasmo's example, please check this one: d:\program file\apps\tools => ..\exam === d:\program file\apps\exam. You can create it using command mklink /D exam ..\exam from d:\program file\apps\tools dir.

Relative paths are relative to a folder where symlink is, not to symlink itself. So if I have a symlink D:\test\test1\test with relative path ..\test, target is D:\test\test1\ + ..\test = D:\test\test.
thomasmo
Junior Member
Junior Member
Posts: 81
Joined: 2013-11-04, 01:31 UTC

Post by *thomasmo »

MVV wrote:petermad,
You can specify full path to symlink, it doesn't matter, you only should use relative target path.
You're right, I've messed it up a bit too with thomasmo's example, please check this one: d:\program file\apps\tools => ..\exam === d:\program file\apps\exam. You can create it using command mklink /D exam ..\exam from d:\program file\apps\tools dir.

Relative paths are relative to a folder where symlink is, not to symlink itself. So if I have a symlink D:\test\test1\test with relative path ..\test, target is D:\test\test1\ + ..\test = D:\test\test.
sorry, I did a mistake, the cmd line is

mklink /d apps ..\apps

type "dir" to look the symbol link in "d:\program file\tool"

"d:\program file\tool\apps" direct to "<SYMLINK> apps [..\apps]"

and the exe file is in "d:\program file\tool\apps\exam\exam.exe"
User avatar
petermad
Power Member
Power Member
Posts: 16113
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

mklink /d apps ..\apps

type "dir" to look the symbol link in "d:\program file\tool"

"d:\program file\tool\apps" direct to "<SYMLINK> apps [..\apps]"

and the exe file is in "d:\program file\tool\apps\exam\exam.exe"
That helped - now I can reproduce the bug.
if the path is made with "/J" to be a absolute path, it also can be run.
I can add that with a junction to relative path (mklink /J apps ..\apps) exam.exe can also be executed.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
thomasmo
Junior Member
Junior Member
Posts: 81
Joined: 2013-11-04, 01:31 UTC

Post by *thomasmo »

petermad wrote:
mklink /d apps ..\apps

type "dir" to look the symbol link in "d:\program file\tool"

"d:\program file\tool\apps" direct to "<SYMLINK> apps [..\apps]"

and the exe file is in "d:\program file\tool\apps\exam\exam.exe"
That helped - now I can reproduce the bug.
if the path is made with "/J" to be a absolute path, it also can be run.
I can add that with a junction to relative path (mklink /J apps ..\apps) exam.exe can also be executed.
"/J" make a full path link

only use "/d" can make a relative path symbold link
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

thomasmo wrote:"/J" make a full path link
That's true, junctions don't support relative paths so the path is resolved by mklink.
User avatar
petermad
Power Member
Power Member
Posts: 16113
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

"/J" make a full path link
Aha - thanks
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50856
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Oh, looks like Microsoft has brought us back a bug which they fixed in IE 10 9.10.9200.16618 and later in ShellExecuteEx function. I already have a workaround for it in TC: I need to resolve the links myself and pass the resolved name to ShellExecuteEx. Thank you Microsoft.
Author of Total Commander
https://www.ghisler.com
thomasmo
Junior Member
Junior Member
Posts: 81
Joined: 2013-11-04, 01:31 UTC

Post by *thomasmo »

ghisler(Author) wrote:Oh, looks like Microsoft has brought us back a bug which they fixed in IE 10 9.10.9200.16618 and later in ShellExecuteEx function. I already have a workaround for it in TC: I need to resolve the links myself and pass the resolved name to ShellExecuteEx. Thank you Microsoft.
brought us back ....

OMG

:twisted:
thomasmo
Junior Member
Junior Member
Posts: 81
Joined: 2013-11-04, 01:31 UTC

Post by *thomasmo »

ghisler(Author) wrote:Oh, looks like Microsoft has brought us back a bug which they fixed in IE 10 9.10.9200.16618 and later in ShellExecuteEx function. I already have a workaround for it in TC: I need to resolve the links myself and pass the resolved name to ShellExecuteEx. Thank you Microsoft.
thank you for fix the bug in b9, but there still has a little problem, if I use the relative symbold-link path with Environment Variables, just like %COMMANDER_PATH%, in the bar to launch exefile, the "run from" path must use quotation marks

Example:

COMMANDER_PATH= D:\Program Files\TotalCommander\

symboldlink:

D:\Program Files\TotalCommander\Tools\ => ..\Exam

the bar button set to

cmd: %COMMANDER_PATH%\Tools\exam.exe
path: %COMMANDER_PATH%\Tools\


it "exam.exe" can't run

but set to

cmd: "%COMMANDER_PATH%\Tools\exam.exe"
path: "%COMMANDER_PATH%\Tools"

it "exam.exe" run!

ofcousr if use full path it can run
Post Reply