把上述结果赋值给一个变量。作者: zh159 时间: 2007-3-21 04:52 for /f "delims=" %%i in ('dir /a/s/b test.exe^|find /i "test.exe"') do set str=%%i
少了in
[ Last edited by zh159 on 2007-3-20 at 04:02 PM ]作者: zts59 时间: 2007-3-21 04:57 谢谢了,加一个要求:
dir /a/s/b test.exe|find /i "test.exe"
对上面这个结果进行判断,如果FIND成功,则把结果赋值变量。如果FIND不成功,则不赋值。作者: zh159 时间: 2007-3-21 05:05 for /f "delims=" %%i in ('dir/a/s/b test.exe^|find /i "test.exe" 2>nul') do set str=%%i