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)
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
Im wondering why doesn't echo %COMMANDER_PATH% return anything?
It will only show the path if TC is runing and you run the command from a command prompt that is started from TC.
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 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.
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?