Extract Path up until the last occurrence of "\" in Batch -
the task simple: given path: c:\auto\proj output: c:\auto. i.e. extract given path until not including last occurrence of "\" in batch.
try this:
set "givenpath=c:\auto\proj" /f "tokens=1,2 delims=\" %%a in ("%givenpath%") set "givenpath=%%a\%%b" echo %givenpath%
Comments
Post a Comment