What's the simplest way in batch to get part of a path?
From other 'suggested questions' I'm now aware of ~dp0, but it seems like that only works on the current working directory?
I want to get a substring out of an environment variable, instead. Specifically, everything up to the final \.
In bash, I can do this with newpath=${fullpath%\\*}, is there an equivalently simple batch construct?
%~dp0~dp0gives output based on the current directory, then? Could you give a brief example of using it with a path stored as a variable?c:\bat\test.batand the current directory wasd:\backupsthen ~dp0 would returnc:\bat