Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在批处理脚本中,我有一个包含文件路径的批处理 var %filePath%。如果我只想从中提取文件名部分,那么命令是什么?
谢谢!
尝试这个:
for /f "delims=" %%i in ("%filePath%") do set "fileName=%%~nxi" echo %fileName%