wait until command is finished batch-Collection of common programming errors
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$
)
)
is there any way to make sure that the variable timepassed is set before it is compared to the value 30? At times, if this portion of code is run, timepassed seems to be evaluated at to be “” instead of what it is supposed to be.
Thanks for the time