Quote:
Originally Posted by boy25
Hi,
I want run batch file one time after 30 sec
I try but all my scripts failed
Code:
#RequireAdmin
#NoTrayIcon
While 1
While fileExists(@ScriptDir&"\anyname.bat")
run(@ScriptDir&"\anyname.bat")
WEnd
Sleep(30000)
WEnd
|
Of course it fails, it will run over and over and over and over again thats why is called while loop...
This will wait 30 secs and work once
Code:
sleep(30000)
if fileExists(@ScriptDir&"\anyname.bat") then
run(@ScriptDir&"\anyname.bat")
endif
This will execute the script every 30 secs
Code:
while sleep(30000)
if fileExists(@ScriptDir&"\anyname.bat") then
run(@ScriptDir&"\anyname.bat")
endif
wend