Solved Executing process at intervals?

May 23, 2012 at 06:41:37
Specs: Windows XP, Athon X2 64 2.8 Ghz/ DDRII 800 Mhz 4 GB
Hello,
I have a doubt in Windows batch programming,

Straight to the point, how to run a program at regular interval?

I have a batch script[Check.bat] which checks for a process in the running list, if it is running then the program quits, else the program shuts down the system.

Now I need another script which launches 'Check.bat' at every 1 minute.

Can anyone help me please!


See More: Executing process at intervals?

Report •

✔ Best Answer
May 24, 2012 at 10:26:39
@echo off
:_loop
check.bat
>nul ping -n 60 localhost
goto :_loop

Tony



#1
May 23, 2012 at 10:32:27
Task scheduler.

Report •

#2
May 23, 2012 at 10:32:54
Haven't used it for the minute. however maybe

schtasks /create /sc minute /mo 1 /tn "viperaliasrajscript" /tr \\%location%\Check.bat
%location% is where the batch is...i didnt know

edit: see above, posted around same time
mike


Report •

#3
May 24, 2012 at 08:26:05
It's extremely simple.
Create a batch file containing the following code:
@echo off
set repetitions=9
echo.Wscript.Sleep 60000> "%tmp%\interval.vbs"
:LOOP
set /A repetitions -=1
if %repetitions%==0 del "%tmp%\interval" & exit
start /w wscript.exe "%tmp%\interval.vbs"
start "" "check.bat"
Goto :LOOP

As you may have already noticed, i created a limited number of loops if you do not want them to be limited then just remove the ones referring to "repetitions".


Report •

Related Solutions

#4
May 24, 2012 at 10:26:39
✔ Best Answer
@echo off
:_loop
check.bat
>nul ping -n 60 localhost
goto :_loop

Tony


Report •

Ask Question