CODE: [Copy to clipboard]@echo off for /f "tokens=3 delims=\" %%i in ("C:\1\2 3\3\4") do set bian=%%i if defined bian echo %bian%