Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

April 01, 1998 12:00 AM

A Better AT

Windows IT Pro
InstantDoc ID #3028
Rating: (0)
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....

Related Content:

ARTICLE TOOLS

Comments
  • Anonymous User
    7 years ago
    Feb 24, 2005

    http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/soon-o.asp

  • Anonymous User
    7 years ago
    Feb 16, 2005

    no

  • Anonymous User
    7 years ago
    Feb 14, 2005

    You guys realize this article was written in 1998?

  • Roy Anderson
    8 years ago
    Jun 14, 2004

    Ditto. I have NT, but no "soon" command?

  • Kevin
    9 years ago
    Nov 07, 2003

    Now that sounds good. How do I get a hold of this soon tool?

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.