HOME       >>       Programming

Timer Command In Dos batch file help


klusk

I wish to execute a command at regular intervals .....precisely every half an hour....Is there any Dos command which can do itI havent found any so far...and i've heard there are no timer commands in DOS.So how should i go about it...i want the batch file to be executed at regular intervals....any external process or application that will invoke it?????


sonesay

You can use windows task scheduler to schedule task, I'm not sure if you can do it every hour though on the links I've seen so far (only 2) it shows only these few options

Daily? Weekly? Monthly? One time only? When my computer starts (before a user logs on)? When I log on (only after the current user logs on)

Maybe you can investigate further in this if you haven't found an option yet. I cannot check for myself since my PC isn't ready accessible. good luck.


klusk

You can use windows task scheduler to schedule task, I'm not sure if you can do it every hour though on the links I've seen so far (only 2) it shows only these few options

Daily Weekly Monthly One time only When my computer starts (before a user logs on) When I log on (only after the current user logs on)

Maybe you can investigate further in this if you haven't found an option yet. I cannot check for myself since my PC isn't ready accessible. good luck.

I checked it out but its not the thing for me....I want it to execute my file atleast every hour
i want it as often as it can be..of course not continuously..... but every fifteen min or so...help me..

rvalkass

What you want to look for is a Windows alternative to the cron system. I don't use Windows, and I don't know exactly what you are looking for, but I am sure that someone will have created some sort of Windows application that will behave like cron. Just run a search and see what comes up:search:cron windows


klusk

What you want to look for is a Windows alternative to the cron system. I don't use Windows, and I don't know exactly what you are looking for, but I am sure that someone will have created some sort of Windows application that will behave like cron. Just run a search and see what comes up:
search:cron windows


thanx ....got what i wanted....i'll be able to run my file now...it'll also let me schedule programs better than the windows scheduler....

iGuest

Replying to kluskGlad to hear you found your solution.Now, how about sharing it with the rest of us?

PatrickMc

For timed and timer'ed commands, you can do something like the following in biterscripting.

while (true)
do
# Do something.
sleep (30*60) # Sleep for 30 mins * 60 seconds.
done

You can also use chex and gettime() to get exactly the mins (say into variable $min), and do something, if ( ($min==0) OR ($min==30) ) .

If you want the loop to end when something happens, you can change the while statement to something like the following.

while ( { lf -n "C:/XXX/..../reportfile.txt } == "") # UNtil there is a reportfile.txt available, for example.

I think a free download is still available at http://www.biterscripting.com/ .

Patrick Mc
Sys Admin



VIEW DESKTOP VERSION REGISTERGET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.