General discussion


Automate tedious admin tasks with these batch files and Task Scheduler

By Bill Detwiler Editor ·
Unix administrators love cron jobs. The power to schedule tasks you would normally run manually is indeed great. Unfortunately, many Windows admins don't do the same, even though the necessary tools are included in Windows. This is perhaps due to the fact that the tool to do this included in the older NT versions of Windows server (the AT scheduler) was difficult to use and often were not reliable. Beginning with Windows 2000, a new, more robust and reliable scheduling tool was available?Windows Task Scheduler. When combined with the command line and batch files, Windows Task Schedule provides admins an effective maintenance automation tool.

This download includes the following four batch files that you can put to use with the Windows Task Scheduler:

clearbad.bat - empties the C:\Inetpub\mailroot\Badmail\ folder on a local IIS 6 SMTP relay server (You may need to modify the bad e-mail folder before the batch file will properly in your environment.)

flushdns.bat - clears the DNS cache of the local machine

shutd.bat - forces open applications to close and then shuts down and restarts the local machine

smtpreset.bat - stops and restarts the SMTP service on the local machine

Download and try these batch files:

Then join this ongoing discussion and let us know if this download is helpful and if there's anything we can do to improve the download's format or content.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Batch Files Used for Weekly Backups

by ewingdweller In reply to Automate tedious admin ta ...

Using the Scheduler program in WinXP Pro, I was able to write batch files to automatically backup copies of our database files. Although our LAN group does tape backup, it may not be as high of a priority for them to restore our db when it gets trashed. That is why I wrote a BAT file to automate this backup.

The script first looks to see which, if any, backup copies exist. It then creates either the first through fourth copy. Once four copies exist, the oldest copy is deleted. Each copy is bumped up one number so that the first copy is the most recent. This script is scheduled to run once a week on Tuesday morning at 10:15 AM as I usually am in the office then.

So far, they seem to be running quite well!

Collapse -

Can you run Task Scheduler via Group Policy

by tysonj In reply to Automate tedious admin ta ...


I want to fully automated computer shutdowns and defrags to approx 150 computers. In reading a lot of forums, I can see no where to do this within AD Group Policies (group policy that set this only disables features on the PC level).

I am thinking the best way to accomplish what I want to do is write scripts with the /at command.

But I would ideally like the solution that the task scheduler calls up the script. This will then give me direct control of timings etc.

Have you got any suggestion?

Related Discussions

Related Forums