if exist "C:\Windows\System32\updatevmcheck.txt" (
set /p Build=<C:\Windows\System32\updatevm.txt
if %Build% LSS 2 (
echo "Run Code Here"
) else (
exit
)
echo 2 > C:\Windows\System32\updatevmcheck.txt
exit
)
ELSE (
echo 1 > C:\Windows\System32\updatevmcheck.txt
exit
)
The above is the current code I have. Basically it checks for the existence of a file, if it's there it checks the file to see if the number in it is less than the one you specify. If so, it runs some code, then updates the number in the file then exits. Otherwise, it creates the file with a number then exits. I believe my syntax is correct and I can run the individual lines, however when I make my batch file it doesn't even seem to get past the if exist statement. Can anyone see anything blatantly wrong with this besides the poor formatting :).
exitin a batch file unless your intention is actually to exit the command processor, e.g. in an interactive session as well. To exit a batch file useexit /borgoto :eof.