Jump to content
xisto Community
klusk

Timer Command In Dos batch file help

Recommended Posts

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?????

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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..

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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....

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.