batch-file - 批处理 : Execute command with quotes in for loop with piping to find

标签 batch-file cmd

您能否建议如何修复下面的命令,该命令从 svn 中删除未版本控制的项目

rem @echo off
for /f "tokens=2*" %%i in ('"c:\Program Files\TortoiseSVN\bin\svn.exe" status --no-ignore ^| find "?"') do echo %%i

下面没有路径的变体工作:
rem @echo off
for /f "tokens=2*" %%i in ('svn.exe status --no-ignore ^| find "?"') do echo %%i

但我需要用 svn.exe 传递整个路径。在这种情况下,它输出 C:\Program is not a valid program

最佳答案

试试这个:

   for /f "usebackq tokens=2*" %%i in (`"c:\Program Files\TortoiseSVN\bin\svn.exe" status --no-ignore ^| find "?"`) do echo %%i

关于batch-file - 批处理 : Execute command with quotes in for loop with piping to find,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11755069/

相关文章:

mysql批处理-执行语句和脚本

python - 在 Windows CMD 中的 Python 2.x 和 3.x 之间切换?

windows 命令行 多个命令

cmd - 从命令提示符启动时更改应用程序的标题

batch-file - 在批处理文件中执行WinSCP命令

batch-file - ffmpeg 批处理在名称中保留旧文件类型

java - 为什么我不能从我的 java 程序运行批处理命令?

无法调用参数中有空格的系统

linux - Windows 中的 `tr` 命令是什么?

windows - 批处理文件抛出错误但是当每个命令在命令行中单独运行时它工作正常