FORFILES - 空格的文件夹路径 [英] forfiles - spaces in folder path

查看:514
本文介绍了FORFILES - 空格的文件夹路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行一个批处理文件,我有中已有一个FORFILES命令

I am running a batch file and i have one forfiles command in it

FORFILES -p%spinputarchrootpath% -m*.csv -d-365 -c"CMD /C DEL @FILE"

%spinputarchrootpath% variable maps to a folder location (Y:\Temp Documents\testfolder).

现在上面的命令是扔因为文件夹名称(临时文件)的空间的错误。

Now the above command is throwing an error because of the space in the folder name (Temp Documents).

如何处理这个空间?我试图把引号%spinputarchrootpath%变量,但它不工作。

How to handle this space? I have tried putting quotes around %spinputarchrootpath% variable but it is not working.

感谢。

推荐答案

用引号将路径:

FORFILES -p "%spinputarchrootpath%" -m *.csv -d -365 -c "CMD /C DEL @FILE"

请注意,有 -p %spinputarchrootpath%的空间。没有在这种情况下,将无法正常工作的空间。

Note, there's a space between -p and "%spinputarchrootpath%". Without a space in this case it won't work.

这篇关于FORFILES - 空格的文件夹路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆