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

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -