How to get a batch file to handle spaces in file names?

泪湿孤枕 提交于 2019-12-01 03:56:06

Try placing quotes around the output file name.

Change

FOR %%f in ("C:\files*.xml") DO 7za.exe a C:\files\zips\%%~nf.zip (%%f)

to:

FOR %%f in ("C:\files*.xml") DO 7za.exe a "C:\files\zips\%%~nf.zip" (%%f)

May also be the variable %%f, may need to place quotes around this as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!