Hourly Cron job for windows

Posted on 2003-12-10
Last Modified: 2012-08-13
How can I schedule a cron job to run every hour?

I'd like to be able to be more sophisticated and run this job once every hour during working hours on monday through friday but that'll do for now
Question by:jayrod
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 62

Expert Comment

by:☠ MASQ ☠
ID: 9915372
Host dependent but, for example ...

Via the "crontab" command from the shell.
crontab -l will show you your currently set up cron jobs on the server.

crontab -r will delete your current cron jobs.

crontab -e will allow you to add or edit your current cron jobs by using your default text editor to edit your "crontab file".

Your crontab includes all the cron jobs you'd like, with one cron entry per line. A cron entry looks like this:

45 2 * * *     /home/user/

The first number is the minute of the hour for the command to run on.
The second number is the hour of the day for the command to run on.
The third number is the day of the month for the command to run on.
The fourth number is the month of the year for the command to run on.
The fifth number is the day of the week for the command to run on.
Here are some examples to help you learn the syntax for the numbers:

32 * * * * : will be run every hour on the 32nd minute.
12,42 * * * * : will be run twice an hour on the 12th and 42nd minutes.
*/15 */2 * * *: will be run at 0:00, 0:15, 0:30, 0:45, 2:00, 2:15, 2:30, ...
43 18 * * 7: will be run at 6:43pm every Sunday.

Author Comment

ID: 9915419
sorry I needed this on a windows platform.. sorry for wasteing your brain cycles.
LVL 62

Expert Comment

by:☠ MASQ ☠
ID: 9915533
Sorry, crons are strictly linux. Could you put it into scheduler?
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

LVL 19

Accepted Solution

Dexstar earned 400 total points
ID: 9915875

> I'd like to be able to be more sophisticated and run this job once every hour
> during working hours on monday through friday but that'll do for now

In Windows, it is called the AT command.  "AT /?" at a command line to see the parameters...  Say you want to run "C:\DoIt.bat" on the computer SOMESERVER every hour Monday through Friday.  You'll have to issue these commands:

     AT \\SOMESERVER 8:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 9:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 10:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 11:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 12:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 13:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 14:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 15:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 16:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 17:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 18:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"

Let me know if you have any problems.

Hope That Helps,

Assisted Solution

e_sandrs earned 50 total points
ID: 9916353
Great info from Dex already.  I'd just expand to note, if this helps you, that on WinXP and/or Win2k3 Server you can use the command "SCHTASKS" instead of "AT".  On Win2k Server, you only have "AT".

Nice, printable help files are available from Start -> Help, searching for "command at", for example.

Eric Sanders
-Just some guy on a board.
LVL 24

Assisted Solution

shivsa earned 50 total points
ID: 9916402
Windows has a builtin "AT" command with similar functionality.

The Windows resource kit contains a GUI version called "WinAt". u may find it very helpful.

this is a example to run job at 8:00 am in the morning for monday to friday.

at 8:00 /every:Mo,Tu,We,Th,Fr, do_something

u may put in a for look in a bat file or copy the same file for wach hour as Dex suggested above.
Once u are done You have to set the "Schedule" service to start automatically though because it does not start by default.

Start > Settings > Control Panel > Services > Highlight Schedule > Click Start > Now Click Startup > Click Automatic > OK
Note you can configure it to be automatically started when you boot your machine.

also winat is quite good.u can download it from here.
LVL 10

Expert Comment

ID: 9919221
it is simple go to Programs - accessories - system tools - Scheduled Tasks
in that u can run the wizard or do it manually to select the job u want to run  , select advanced to schedule every hour . There are whole lot of options to set there !


Author Comment

ID: 9920117
Thanks for all of the help you all :)

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question