When I start the batch file as posted below, I got this error
( was unexpected at this time.
I think this happens on the IF command line if %ad%==60 (
but I am not sure.
( was unexpected at this time.
@echo off
color 0f
title TITLE
mode con cols=50 lines=25
set ad = 0
set s = 0
set m = 0
set h = 0
set d = 0
if exist start.txt (
del start.txt
goto :1
) else (
exit
)
:1
if %ad%==60 (
:: Something here
set ad = 0
)
:: MINUTES
if %s%==60 (
set /a m=m+1
set s = 0
)
:: HOURS
if %m%==60 (
set /a h=h+1
set m = 0
)
:: DAYS
if %h%==24 (
set /a d=d+1
set h = 0
)
cls
echo Something here...
timeout 1 > nul
set /a ad=ad+1
set /a s=s+1
goto :1
What could be the reason for this error message on execution of the batch file?