Is there a quick way to get the filename and last folder from a full file path (string) in Windows command line?
I would expect for 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've been banging my head at this using FOR /F but since the full path can be any length, I can't figure it out.