1
In my batch script I have the following:
if somecondition (
exit
) else (
for /F "USEBACKQ tokens=4,6,8" %%a in (systeminfo ^| qgrep -e "System Up Time:") do set days=%%a&set hours=%%b&set minutes=%%c
set /A timepassed=%days%*24*60+%hours%*60+%minutes%
if "%timepassed%" leq 30 (
echo %timepassed%
) else (
echo %time$
)
)
有什么办法可以确保变量timepass被设置之前,它是与值30相比吗? 有时候,如果这部分代码运行,timepass似乎被评估为“”,而不是它应该是什么。等到命令完成批处理
感谢您的时间
你是否在另一个块中做这个? – Joey 2012-07-19 19:20:43
是的,我修改它真的很快 – 2012-07-19 19:22:03