怎样把bat中别的exe的输出结果当成变量继续运行bat?
这个是bat里的一段代码
@set WORKFOLD=$/vsstest913
ss Checkout "%WORKFOLD%/hello.txt"
调用了vss后,ss.exe会输出一段反馈字符串,如:
"You currently have file $/vsstest913/hello.txt checked out"
我想要把这段输出当成变量string,继续下面的代码:
IF string = *** do [command]
不知道应该怎样实现呢?
用FOR /F "usebackq delims=" %i IN (`ss Checkout "%WORKFOLD%/hello.txt"`) DO @echo --%i--
貌似没有什么用.
------解决方案--------------------
怎么没用?没ss.exe,直接echo测试:
BatchFile code
set WORKFOLD=$/vsstest913
for /f "delims=" %i in ('echo ss Checkout "%WORKFOLD%/hello.txt"') do echo %i