CODE: [Copy to clipboard]set str=a\ba\zhong\meiy\zh.exe for %%a in ("%str%") do @echo %%~nxa for %%a in ("%str%\..") do @echo %%~nxa