a timed Batch

Hewlett-packard Pavilion dv6-2190us note...
June 12, 2010 at 03:19:59
Specs: Windows Vista
i need a running batch file to close after a certain amount of time has passed
here what the code would essentially look like

call "C:\certain file here.bat"
echo file is now gonna run for 10 minutes
echo 10
echo 9
echo 8
echo 7
echo 6
echo 5
echo 4
echo 3
echo 2
echo 1
echo file will now close

See More: a timed Batch

Report •

June 12, 2010 at 08:57:21
Take a look at this page:

SLEEP (on topic) and TAIL (off topic) from the Windows Server
2003 Resource Kit mentioned on that page run fine on my XP
machines, and may(?) do so as well in Vista. That page also
talks about (or links to) the PING method as well

Report •

June 12, 2010 at 09:34:01
i don't have vista, but on XP choice can also be used:

echo file is now gonna run for 10 minutes...
:: if you "call" your other batch, you won't have access to your
:: timer while other script is running...
start mybat.bat
for /L %%a in (9 -1 1) do call :timer %%a
goto :eof

choice /n /c:%1 /t:%1,60 < nul
::-------- end
if you need to terminate the child-script, you can either have it time itself then self-terminate, or you could have the parent script do the task-kill at end of 10-count.

Report •

June 12, 2010 at 11:01:36
thanks, i had a brain wave.

i can just kill cmd after a certain amount of time

hahaha why didn't i just think of that.

Report •
Related Solutions

Ask Question