A Better AT

Three tools for controlling NT's Schedule service

In last month's Inside Out column, "Where It's AT," I described some features of the Windows NT Schedule service and the service's management tool, at.exe. Three tools in the Microsoft Windows NT Server Resource Kit and Microsoft Windows NT Workstation Resource Kit can make AT even better.

I use the Command Scheduler (winat.exe) more than any other resource kit tool. If you've used the AT command, you know that it can be frustrating to work with. You must type long strings of commands, and if you mistype one character, you have to start over. The Command Scheduler lets you use a GUI to implement the Schedule service.

The Command Scheduler lists the jobs in a computer's schedule queue, each job's ID, the day and time each job is scheduled for, and whether the job includes the /interactive option (which lets an AT program display dialog boxes and receive commands via the GUI). Double-click an item in the schedule queue, and the Command Scheduler provides a dialog box that lets you adjust the job's features. Like the Schedule service, the Command Scheduler can control schedules for every NT machine on your network.

I also frequently use the resource kit's SOON tool. If you tried to execute the examples in last month's Inside Out, you might have run into the "What time is it?" problem. Suppose I want to run a program called beep.bat that makes my computer beep. I have to look at my computer's clock and schedule beep.bat for a later time. If the computer thinks the time is 11:43 a.m. and 37 seconds, I might open a command line and type

at 11:44 c:\beep.bat

If I press Enter before the clock hits 11:44, the computer will beep. However, if I'm not quick enough, the computer will schedule the command for 11:44 a.m. tomorrow.

The SOON tool eliminates this timing problem. It lets you schedule events for a future time, relative to the current time (in seconds). For instance, you can use SOON to schedule a beep for 1 minute from now, rather than for 11:44. SOON replaces AT, and the syntax is similar to AT's:

soon <\\machinename> <delay_in_seconds> \[/interactive\] <command>

SOON's greatest strength is scheduling repetitive commands. For example, suppose I want my computer to beep every hour. I can write the following batch file, which I'll call beepit.bat:

@echo off
echo ^G
soon 3600 c:\beepit.bat

I created the ^G in the second line of this batch file by holding down the Ctrl key and pressing the G key. Because I did not include a machine name, the computer I typed the command on will beep. To start the beeping, I type

beepit

from a command line. The system will beep once, and SOON will schedule the batch file to run again an hour later.

The third AT-related resource kit tool, sleep.exe, lets you schedule a program to wait for a specified period (also in seconds) before continuing. Suppose you want to schedule a backup of a computer's D drive, and you need to kick all users off the server. First, use the NET PAUSE SERVER command to keep users from attaching to the server. Next, use the NET SEND * command to notify users who are already on the server that their connection will terminate in 5 minutes. (For more information on the NET commands, see Michael D. Reilly, "NET Commands," November 1997.) Use the SLEEP command to instruct the computer to wait 5 minutes before continuing. Finally, use the NET STOP SERVER command to kick everyone off the server. Here's the command sequence:

@echo off
net pause server
net send * Please get off this server. It will go down in 5 minutes.
sleep 300
net stop server
ntbackup d: ... <whatever_options_you_need>
net start server

The Command Scheduler, SOON, and SLEEP are three powerful resource kit tools that I use regularly to control the NT Schedule service. Now, if only they could control my daily schedule....

Discuss this Article 11

Anonymous User (not verified)
on Feb 14, 2005
You guys realize this article was written in 1998?
Roy Anderson (not verified)
on Jun 14, 2004
Ditto. I have NT, but no "soon" command?
Anonymous User (not verified)
on Feb 24, 2005
http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/soon-o.asp
Anonymous User (not verified)
on Feb 16, 2005
no
Kevin (not verified)
on Nov 7, 2003
Now that sounds good. How do I get a hold of this soon tool?
Glenn Klein (not verified)
on Aug 11, 1999
I read Mark Minasi’s articles “Where It’s AT” (March) and “A Better AT” (April) about the AT command. Recently, I came across Microsoft TechNet article Q142040 that helps people more easily troubleshoot the AT command. The article suggests a way to troubleshoot a batch job scheduled to run using the AT command. Type

AT /interactive cmd.exe /k

to bring up a DOS session running under the environment of the AT command scheduler. Through this process, you can easily troubleshoot AT commands.
--Glenn Klein

Please or Register to post comments.

IT/Dev Connections

Las Vegas
September 30th - October 4th

Paul ThurottYou'll have the opportunity to experience:
• The Microsoft
Technology Roadmap
• Office 365 Implementation
• Hyper-V Optimizing
• Windows 8 Deployment
and much more!

Come See Paul Thurrott & Rod Trent in Person!

Early Registration Now Open

Upcoming Training

Mastering System Center 2012

During over 6 hours of training you can join John Savill from your computer as he will walk you through the key components and capabilities of System Center 2012, what’s involved in using the components, and the benefit they can bring to your environment.

Register Now

Current Issue

May 2013 - The NameTranslate object is useful when you need to translate Active Directory object names between different formats, but it's awkward to use from PowerShell. Here's a PowerShell script that eliminates the awkwardness.

CURRENT ISSUE / ARCHIVE / SUBSCRIBE

Windows Forums

Get answers to questions, share tips, and engage with the Windows Community in our Forums.