how to run batch file one time after 30 sec

11/30/2019 03:48 boy25#1
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
11/30/2019 04:03 elmarcia#2
Quote:
Originally Posted by boy25 View Post
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
11/30/2019 19:56 boy25#3
thanks my sir
thanks very much