空间批处理文件路径 [英] Space in batch file path

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

问题描述

我想运行一个简单的批处理文件。

  FOR / F %%一个IN('DIR / B / S%〜DP0 \\ EnsembleIndependant \\ *错。')DO(ECHO %% A>> ResultatVorace .TXT和放大器; CALL vorace.exe -f %% A>> ResultatVorace.txt)

如果在批处理文件的路径没有空格这仅适用。

该批次是:

C:\\用户\\拉斐尔\\文档\\ Visual Studio 2012中\\项目\\ vorace \\发布\\ vorace.exe

我要循环的文件,通过在:

C:\\用户\\拉斐尔\\文档\\ Visual Studio 2012中\\项目\\ vorace \\发布\\ EnsembleIndependant

谁能帮助我。

感谢。

感谢您的建议家伙。
FOR / Fdelims =解决了我的问题。


解决方案

  FOR / Fdelims =%%一个IN('DIR / B / S%〜dp0EnsembleIndependant \\ *。 .mis')DO(ECHO %% A>> ResultatVorace.txt&安培; CALL vorace.exe -f %% A>> ResultatVorace.txt)

%〜DP0 早已在最后一个退格。

I'm trying to run a simple batch file.

for /f %%a IN ('dir /b /s "%~dp0\EnsembleIndependant\*.mis"') DO (ECHO %%a >> ResultatVorace.txt & CALL vorace.exe -f %%a >> ResultatVorace.txt)

this only works if there is no space in the path of the batch file.

the batch is in:

C:\Users\Rafael\Documents\Visual Studio 2012\Projects\vorace\Release\vorace.exe

the files I want to loop through are in:

C:\Users\Rafael\Documents\Visual Studio 2012\Projects\vorace\Release\EnsembleIndependant

can anyone help me.

thanks.

thank you guys for the suggestions. for /f "delims=" solved my problem.

解决方案

for /f "delims=" %%a IN ('dir /b /s "%~dp0EnsembleIndependant\*.mis"') DO (ECHO %%a >> ResultatVorace.txt & CALL vorace.exe -f %%a >> ResultatVorace.txt)

%~dp0 has already a backspace at the end.

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

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