DOS variable set to current directory ONLY. Not the entire path.
Posted on 2009-07-08
This returns the current directory, but with the entire path as well. How can I get JUST the current directory?
Say this is the path: C:\WINDOWS\system32\2008-02-29_1157 I'm working in.
"set currentdir=%cd%" would set the currentdir variable to "C:\WINDOWS\system32\2008-02-29_1157" (if run from inside that directory, of course)
That's handy, but how would I set a variable to the actual current directory ONLY. I need the variable set to: "2008-02-29_1157" only.
The reason for this is that I need to use tokens of that variable to rename files located in that directory.