• 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?
2 Solutions
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)
Delphineous SilverwingGood Ol' GeekCommented:
Take a look at this Microsoft article for scheduling tasks in 2003 server:
To schedule a batch file to run at regular intervals


      Click Start and then click Control Panel.

      In the Control Panel, double-click Scheduled Tasks.

      The Scheduled Tasks window opens.

      Double-click Add Scheduled Task.

      The Scheduled Task Wizard opens.

      Click Next and then click Browse.

      The Select Program to Schedule dialog box appears.

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

      Click the batch file and then click Open.

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

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

      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.

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

      Click Finish.

      The new task appears in the Scheduled Tasks window.
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.
Tyson0317Author Commented:
See? I knew it was easy, just forgot how to do it! Thaks for quick reply!

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