I tested this on my Windows 11 system and it is not as described in the help.Help - Dialog box: Configuration - Change button bar wrote: Warning: Programs run as administrator will always start with the program directory as the start path, and environment variables (like %COMMANDER_PATH%) are NOT inherited from Total Commander, only those from the system. It also does not work directly with .bat and .cmd files. Please put cmd.exe /c in front of it.
There is only a problem when TC is not running as Administrator and I run programs as Administrator. This is assumed in the text below.
Environment variables like %COMMANDER_PATH% are NOT inherited from Total Commander. This is also the case when running batch files, no matter if I put cmd.exe /c in front of it.
The start path is another matter. The default start path is the active panel folder. There is an issue if the program is located in c:\Windows\ or c:\Windows\System32\ or c:\Windows\SysWOW64\. Then the start path is ignored and the folder c:\windows\system32 is always used as start path. So this also the case for batch files because they are run via cmd.exe located in c:\Windows\System32\.
Example:
I copied cmd.exe and en-US\cmd.exe.mui in the c:\windows\system32 folder to d:\TEST\cmd. So I have these files/folders:
Code: Select all
d:\TEST\cmd\cmd.exe
d:\TEST\cmd\en-US\cmd.exe.mui
This is a Windows thing. The same happens when I run a program as Administrator using Windows Explorer or Windows Run.