• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2636
  • Last Modified:

How to run a .bat file on a schedule?

This should be a simple one but I dont remember how to do it...

I have a script in a bat file that I need to run every 4 hours on our server (even if the server is logged off). How do I accomplish this?
0
Tyson0317
Asked:
Tyson0317
2 Solutions
 
jfolcikCommented:
run the command "tasks" from the run command, then create the task to run daily and recur every 4 hours (the recurring can be added after creating it and going to properties of it)
0
 
Delphineous SilverwingGood Ol' GeekCommented:
Take a look at this Microsoft article for scheduling tasks in 2003 server:
http://support.microsoft.com/kb/814596/en-us
0
 
defkamelCommented:
To schedule a batch file to run at regular intervals

   1.

      Click Start and then click Control Panel.
   2.

      In the Control Panel, double-click Scheduled Tasks.

      The Scheduled Tasks window opens.
   3.

      Double-click Add Scheduled Task.

      The Scheduled Task Wizard opens.
   4.

      Click Next and then click Browse.

      The Select Program to Schedule dialog box appears.
   5.

      Navigate to the folder that contains the batch file you wrote.
   6.

      Click the batch file and then click Open.
   7.

      (Optional) Change the name of the scheduling task that you are creating.
   8.

      Under Perform this task, select the frequency with which you want the batch file to run, and then click Next.
   9.

      Depending on the frequency you selected, the next page might require you to provide more detail about the times you want the batch file to run, such as the start time and start date. When you are finished, click Next.
  10.

      Type your user name and password, and then click Next.
  11.

      Click Finish.

      The new task appears in the Scheduled Tasks window.
0
 
oldmuttonheadCommented:
From a command line, run the "at" command.  Typing "at /?" will give you the details on how to use it.  You can also add it as a scheduled task in the control panel.
0
 
Tyson0317Author Commented:
See? I knew it was easy, just forgot how to do it! Thaks for quick reply!
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now