Link to home
Start Free TrialLog in
Avatar of Tyson0317
Tyson0317

asked on

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?
ASKER CERTIFIED SOLUTION
Avatar of jfolcik
jfolcik

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Delphineous Silverwing
Delphineous Silverwing
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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.
Avatar of Tyson0317
Tyson0317

ASKER

See? I knew it was easy, just forgot how to do it! Thaks for quick reply!