Is there a quick way to get the file name and last folder from the full path of a file (line) on the DOS command line?
I would expect input -> results:
"c:\test\1\2\test.txt" -> "2", "test.txt" "c:\test\1\2\3\a.txt" -> "3", "a.txt" "c:\test\0\b.txt" -> "0", "b.txt" "c:\c.txt" -> "", "c.txt"
I hit my head about this using FOR / F, but since the full path can be any length, I can't figure it out.
Thanks!
source share