Hi guys,
I'm a little newish to DOS and command prompt but have made a few batch files.
I know that opening command prompt and echo %path% will return the environmental variables of PATH (the locations that are associated with it)
Im wondering why doesn't echo %COMMANDER_PATH% return anything?
Thanks,
Jimmy
cmd: echo %path%, echo %COMMANDER_PATH% returns nothing
Moderators: white, Hacker, petermad, Stefan2
- JimmyTheBroker
- Member
- Posts: 179
- Joined: 2017-06-07, 05:22 UTC
cmd: echo %path%, echo %COMMANDER_PATH% returns nothing
I finally get notifications from emails again!!!
So happy!
So happy!
- JimmyTheBroker
- Member
- Posts: 179
- Joined: 2017-06-07, 05:22 UTC
The reason why i'm interested in this is because I am moving the totalcmd directory around from device to device and from hard-drive to hard-drive.
windows10 Taskbar shortcut:
"C:\Program Files (x86)\totalcmd\TOTALCMD64.EXE"
which no longer works if I create a new copy in another location and delete the original copy.
I had hoped that if I made the windows10 Taskbar shortcut:
"%path%\totalcmd\TOTALCMD64.EXE"
it would search all the path locations, checking until it found TOTALCMD64.EXE and then open that.
Does anyone if this is possible, or a better solution?
I *think I might*, be able to do something like this using a batch file but that seems like a lot of work for something that should already exist.
Let me know what you think,
Jimmy
windows10 Taskbar shortcut:
"C:\Program Files (x86)\totalcmd\TOTALCMD64.EXE"
which no longer works if I create a new copy in another location and delete the original copy.
I had hoped that if I made the windows10 Taskbar shortcut:
"%path%\totalcmd\TOTALCMD64.EXE"
it would search all the path locations, checking until it found TOTALCMD64.EXE and then open that.
Does anyone if this is possible, or a better solution?
I *think I might*, be able to do something like this using a batch file but that seems like a lot of work for something that should already exist.
Let me know what you think,
Jimmy
I finally get notifications from emails again!!!
So happy!
So happy!
- ghisler(Author)
- Site Admin
- Posts: 48088
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
echo %COMMANDER_PATH%
does return something, but ONLY if you open cmd.exe from within Total Commander.
Why?
%COMMANDER_PATH% isn't defined in the system, because you could have multiple running Commanders from different directories at the same time. Total Commander sets it at runtime in its own process. When you start a process like cmd.exe, it inherits these variables from the program which started it.
does return something, but ONLY if you open cmd.exe from within Total Commander.
Why?
%COMMANDER_PATH% isn't defined in the system, because you could have multiple running Commanders from different directories at the same time. Total Commander sets it at runtime in its own process. When you start a process like cmd.exe, it inherits these variables from the program which started it.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
It will only show the path if TC is runing and you run the command from a command prompt that is started from TC.Im wondering why doesn't echo %COMMANDER_PATH% return anything?
You cannot use %path% this way - %path% is a list of paths, you cannot just append anything to that list in the way you tried. You could add c:\totalcmd\ permanently to the %path% (see * below), and then just write TOTALCMD64.EXE in the Target field, but the problem is that Windows will automatically insert c:\totalcmd\ in front of TOTALCMD64.EXE when you close the shortcut properties dialog.I had hoped that if I made the windows10 Taskbar shortcut:
"%path%\totalcmd\TOTALCMD64.EXE"
it would search all the path locations, checking until it found TOTALCMD64.EXE and then open that.
You can make environtment variables work in a shortcut like this:
1. Run SystemPropertiesAdvanced.exe
2. Click on the button "Environment Variables..."
3. In the top of the dialog click the "New..." button
4. For Variable name enter somthging unique - like MY_TC
5. For Variable value enter the physical path to TC executable (for example c:\totalcmd\totalcmd64.exe)
6. Press OK 2 times.
Now you can change the shortcut Target to: %MY_TC%
Unfortunately environment variables does not work in Windows' Taskbar, although it works for Desktop shortcuts. So you cannot use it in the Taskbar.
* If you want to add c:\totalcmd\ to the %path% variable, use SystemPropertiesAdvanced.exe and then find and edit the PATH in the bottom of the dialog.
But why don't you just enter the proper path in your shortcut?
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar