PowerUsers.info - Paul Doherty Askme Archive of Questions and Answers

Return to AskMe Archive Main Page

Return to Main PowerUsers.info Main Page

Category : Windows NT


----------------------------------------------------------------------
FAQId : 5748427
Subject : Running scheduled task on NT server 4.0

Question : Hi,

I have a vbs file that I run daily on a windows 98 computer. I set this up using the scheduled task wizard in the control panel. I want to move this file to an NT server and eventually to a Windows 2000 server. Is there a way to schedule a script to run daily in these 2 operating systems>

thanks
donna

Answer : Sure you can - in NT/2000 you will use the 'at' utility to schedule jobs to run. Make sure the "scheduler" service is installed and enabled on your machine (required for 'at' to work).

To add an item to run with at follow this example:

at 14:30 "d:\wherever\myprog.bat"

The above command would schedule a one-time run of 'myprog.bat' at the next
occurrence of 2:30PM (at uses miltary time, so it's 14:30). If you ran this
before 2:30PM it would run the same day, otherwise it would be scheduled for
"tomorrow" when viewed with 'at' alone at a prompt.

Example 2:

at 01:00 /every:1,5,10,15,20,25 "d:\wherever\myprog.bat"

This command would run 'myprog.bat' on the 1st, 5th, 10th, 15th, 20th and
25th of each month at 1:00 AM.

Example 3:

at 01:00 /every:M,W,F,Su "d:\wherever\myprog.bat"

This command would run 'myprog.bat' every Monday, Wednesday, Friday and Sunday
at 1:00 AM.

'at' commands issued with the "/every" parameter will be persistent and will
stay in the scheduler database (and therefore be run at the set intervals)
until they are deleted. To delete an event in the at scheduler issue the
following command (after using 'at' alone to determine the ID number):

at ID# /delete

so for a job with ID #45 it would be:

at 45 /delete

And to delete *all* jobs in the at schedule issue:

at /delete


--
Paul Doherty
http://members.home.net/iqueue
DOS/Windows Utilities

Rating :

PowerUsers.info - Paul Doherty Askme Archive of Questions and Answers

Return to AskMe Archive Main Page

Return to Main PowerUsers.info Main Page