I have a problem with the code I have written and been trying to run in batch. Here it is:
echo off
SETLOCAL
set a==%time /t%
if (a!=18:00) goto stop
else goto start
:start
net stop "spooler"
timeout 3 > null
echo "it is done"
timeout 5 > null
echo "now we restarting the service"
timeout 3 > null
net start "spooler"
:stop
PAUSE
ENDLOCAL
What it was supposed to do is to check the current time on machine verify with the one pre-conditioned in the code and if it does not match or does, act accordingly. I don't know why (probably because of me being the novice) it returns the error message which says:
=18:00 was unexpected at this time
Any suggestions?
Thanks in advance,
R. Shahin