Cannot execute a command via a symbolic link
Moderators: Hacker, petermad, Stefan2, white
-
- Junior Member
- Posts: 5
- Joined: 2008-08-16, 10:06 UTC
Cannot execute a command via a symbolic link
I cannot use the Total Commander command line to execute a command that is referenced through a symbolic link. An error message stating "Search path not found!" appears.
Win7 64-bit, TC 8.0RC3 64-bit and 32-bit
I created a simple test case as follows:
In an empty directory "temp"
mkdir foo
copy c:\windows\system32\notepad.exe foo
mklink np.exe foo\notepad.exe (requires elevated/admin permissions)
With TC having focus on "temp", try to execute np.exe.
The error message will appear.
Clicking on np.exe in the pane works, you just cannot use the TC command line.
Win7 64-bit, TC 8.0RC3 64-bit and 32-bit
I created a simple test case as follows:
In an empty directory "temp"
mkdir foo
copy c:\windows\system32\notepad.exe foo
mklink np.exe foo\notepad.exe (requires elevated/admin permissions)
With TC having focus on "temp", try to execute np.exe.
The error message will appear.
Clicking on np.exe in the pane works, you just cannot use the TC command line.
Hello, RichieTheK.
Try to use an absolute pathname instead of a relative pathname in your mklink commandline. provided this is where notepad.exe has been copied to.
When trying to execute np.exe from a commandline keep in mind that np.exe itself is located inside C:\Temp which is unlikely to be included in the %PATH% variable.
Hence at the command prompt you will have to execute
Kind regards,
Karl
Try to use an absolute pathname instead of a relative pathname in your mklink commandline.
Code: Select all
mklink np.exe C:\Temp\foo\notepad.exe
When trying to execute np.exe from a commandline keep in mind that np.exe itself is located inside C:\Temp which is unlikely to be included in the %PATH% variable.
Hence at the command prompt you will have to execute
Code: Select all
C:\temp\np.exe
Karl
MX Linux 21.3 64-bit xfce, Total Commander 11.50 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
RichieTheK, please try to double-click your symlink in Explorer, it shows error too.
And it is strange because it can be started via Win+R, CMD.exe, Enter or double-click from TC. Also it can be started from TC command line using full path (Ctrl+Shift+Enter)
Symlinks are strange objects, they can't transfer dates and sizes, their creation requires elevation etc. If you want to start notepad from TC command line by typing just np, maybe you should create an alias for Notepad.exe in Configuration\Misc TC dialog.

Symlinks are strange objects, they can't transfer dates and sizes, their creation requires elevation etc. If you want to start notepad from TC command line by typing just np, maybe you should create an alias for Notepad.exe in Configuration\Misc TC dialog.
-
- Junior Member
- Posts: 5
- Joined: 2008-08-16, 10:06 UTC
KarlChen - The symlinks that I create for day-to-day use do contain absolute paths. The link is created in a utility directory that is on the search path. The target is an absolute reference to an executable which is not on the search path. I'm sorry that the test case that I created used relative paths and gave the wrong impression. In any case, regardless of whether the target is absolute or relative, I get the same error: "Search path not found!". The symlinks work from the command-processor and through direct clicking, just not from the TC command line.
MVV - I agree that symlinks are strange. I realize that I could use "alias", but I was hoping that I wouldn't have to duplicate the effort, creating a symlink for use with the command-processor and an additional alias for TC.
Thanks for your replies.
MVV - I agree that symlinks are strange. I realize that I could use "alias", but I was hoping that I wouldn't have to duplicate the effort, creating a symlink for use with the command-processor and an additional alias for TC.
Thanks for your replies.
Hello, RichieTheK.
OK. I think I do understand the problem better now:
But it has. Proof:
Cheers,
Karl
OK. I think I do understand the problem better now:
- Target executable: D:\LOCAL-Data\Utils\Notepad2\Notepad2.exe (folder not included in %PATH%)
- Current folder: C:\windows\system32 (definitely included in %PATH%)
- Command: mklink np.exe D:\LOCAL-Data\Utils\Notepad2\Notepad2.exe
- Running np from any folder in cmd.exe: Notepad2 will be launched.
- Running np from the Total Commander commandline: Error Message "Search path not found!"
- Running C:\Windows\system32\np.exe from the Total Commander commandline: Notepad2 will be launched.
But it has. Proof:
- Running notepad from the Total Commander commandline: Notepad is launched.

Cheers,
Karl
MX Linux 21.3 64-bit xfce, Total Commander 11.50 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
This seems to be a bug in ShellExecuteEx function. Maybe someone can test that...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com