|
| |
$WAITFOR (Wait for a specified time)
Description
Waits for the requested time (with screen updates), then executes an [optional] command.
Syntax
At the Command Prompt (library
IS NOT initialized)
|
C:\>NTCmdLib |
$WAITFOR WaitTime RefreshInterval ["Command/Program"] |
At the Command Prompt (library
IS initialized)
|
C:\>L
|
$WAITFOR WaitTime RefreshInterval ["Command/Program"] |
In a Script (library
IS NOT initialized)
|
CALL
NTCmdLib |
$WAITFOR WaitTime RefreshInterval ["Command/Program"] |
In a Script (library IS
initialized)
|
%.Call% |
$WAITFOR WaitTime RefreshInterval ["Command/Program"] |
Parameters and Switches
| WaitTime |
|
How long to wait (in minutes). |
| RefreshInterval |
|
How often to update the console status message (in minutes) |
| "[Command/Program]" |
|
Optional Command or Program to execute after waiting. If no Command/Program is
specified, a default of .Rem will be executed. |
Errorlevels, Output Variables and Custom Mount/\Commands
|
Name |
|
Value |
|
Description/Contents |
|
_WAITFOR |
|
string |
|
Text message indicating Success or
Failure |
|
ErrorLevel |
|
Description/Contents |
|
0 |
|
Success |
|
2 |
|
Missing or invalid parameter |
Examples, Notes and Instructions
Example 1 - Start a batch file after two hours, updating the console every 30 minutes
|
C:\GuardPost>NTCmdLib
$WAITFOR 120 30 "DailyBackup.cmd"
^ =========================================================================
/!\ NTCmdLib.cmd 2003.04.24 NT/2K/XP/K3 ("Almost Freeware" at $9 or less!)
/LIB\ =========================================================================
[Thu 04/24/2003 18:00:00] 120 minute(s) left...
[Thu 04/24/2003 18:30:00] 90 minute(s) left...
[Thu 04/24/2003 19:00:00] 60 minute(s) left...
[Thu 04/24/2003 19:30:00] 30 minute(s) left...
[Thu 04/24/2003 20:00:00] WAITFOR Completed.
{DailyBackup.cmd starts here} |
Example 2 - Display a message after five minutes, updating the console each minute
|
C:\GuardPost>NTCmdLib
$WAITFOR 5 1 "ECHO:We're
movin' on!"
^ =========================================================================
/!\ NTCmdLib.cmd 2003.04.24 NT/2K/XP/K3 ("Almost Freeware" at $9 or less!)
/LIB\ =========================================================================\
[Thu 04/24/2003 14:47:24] 5 minute(s) left...
[Thu 04/24/2003 14:48:24] 4 minute(s) left...
[Thu 04/24/2003 14:49:24] 3 minute(s) left...
[Thu 04/24/2003 14:50:24] 2 minute(s) left...
[Thu 04/24/2003 14:51:24] 1 minute(s) left...
[Thu 04/24/2003 14:52:24] WAITFOR Completed.
We're movin' on!
C:\GuardPost>SET
_WAITFOR
_WAITFOR=Waited for about 5 minutes as requested.
|
Notes
- Output is displayed to STDOUT, errors to STDERR
- To suppress console display, use the library GlobalSwitch /Quiet (or simply /q)
NTCmdLib /Q TaskID /TaskSwitches Parameters
CALL NTCmdLib /Q TaskID /TaskSwitches Parameters
%.Call% /Q TaskID /TaskSwitches Parameters
Related .Mount/\Commands, #Constants,
$Functions, :Procedures
|
Resource |
|
Short Description |
| |
|
|
|
K
E
Y |
Common Commands |
INTERNAL |
External |
/SWITCH |
Parameter |
Help text |
AddonTool |
|
Mounted Commands |
.Mount/\Command |
CmdShorthand |
#Constant |
$FUNCTION |
:Procedure |
!GuardNote |
|
Operating Systems |
NT/2K/XP/K3 |
NT Only |
NT/2K |
2K Only |
2K/XP |
XP Only |
XP/K3 |
K3 Only |
2K/XP/K3 |
|