Home > Commands N-Z > Commands S

SOON


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Schedule a command to run in the near future (calls the AT command).


Syntax

SOON [\\computer_name] delay [[/i[nteractive]] | [/i:[on | off]]] "command"


Parameters
"command" (NT4)
A remote computer to shutdown.
\\computer_name (NT4)
The UNC location of the remote machine.
delay (NT4)
When the command should run, in SECONDS from now.
Because SOON passes a start time to AT in HH:MM you must set a delay > 60 seconds.

Switches
/i:[on | off] (NT4)
Make /interactive the default behaviour use SOON /i:off to restore normal behaviour.
/interactive (NT4)
Allows any user to see the job as it runs, this allows testing and monitoring of the command. You can specify as just /i.

Related

AT - Schedule a command to run at a later time.
Equivalent Linux BASH commands:
cron - Daemon to execute scheduled commands.
crontab - Schedule a command to run at a later time.
watch - Execute/display a program periodically.


Notes

The "Task Scheduler" service must be running to use SOON.

SOON schedules jobs to run at a time relative to the current time "minutes from now"

Rescheduling a job with SOON therefore requires no editing of the SOON command.

The most frequent difficulty people have with SOON is seemingly unreliable execution when attempting to use a delay of 60 seconds or less - see Q237840.

As with all AT jobs you should test your SOON scripts extensively by using the /INTERACTIVE option to be sure that they:

Recurring Jobs:

It is possible to set up a recurring job with SOON, the advantage of this over AT is that the system will never try to execute the same CMD script twice at the same time (because the SOON delay is relative to the last completion).


Examples

Here's a trivial example - a 10 minute reminder:

    @ECHO OFF
   ::remindme.cmd
   NET SEND
   %username%
   hello
   ECHO Remind Me again?
   PAUSE
   SOON 600 /interactive C:\examples\remindme.cmd
   :eof

Start the script above running with:

   SOON 600 /interactive C:\examples\remindme.cmd

and press Control-C to stop.


Errorlevels

none.


Availability
External Resource Kit
DOS
none
Windows
none
Windows NT
NT4