Waitfor


Applies To: Windows Server 2003 with SP1,Windows XP,Windows Server 2008,Windows Server 2008 R2,Windows Server 2000,Windows Server 2003 with SP2,Windows Server 2003,Windows Vista,Windows 7,Windows Server 2003 R2

Sends or waits for a signal on a system. Waitfor is used to synchronize computers across a network.

For examples of how to use this command, see Examples.

Syntax


Copy Code

waitfor [/s <Computer> [/u [<Domain>\]<User> [/p [<Password>]]]] /si <SignalName>
waitfor [/t <Timeout>] <SignalName>

Parameters

Parameter

Description

/s <Computer>

Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer. This parameter applies to all files and folders specified in the command.

/u [<Domain>\]<User>

Runs the script using the credentials of the specified user account. By default, waitfor uses the current user's credentials.

/p [<Password>]

Specifies the password of the user account that is specified in the /u parameter.

/si

Sends the specified signal across the network.

/t <Timeout>

Specifies the number of seconds to wait for a signal. By default, waitfor waits indefinitely.

<SignalName>

Specifies the signal that waitfor waits for or sends. SignalName is not case-sensitive.

/?

Displays help at the command prompt.

Remarks

Examples

To wait until the "espresso\build007" signal is received, type:


Copy Code

waitfor espresso\build007

By default, waitfor waits indefinitely for a signal.

To wait 10 seconds for the "espresso\compile007" signal to be received before timing out, type:


Copy Code

waitfor /t 10 espresso\build007

To manually activate the "espresso\build007" signal, type:


Copy Code

waitfor /si espresso\build007

Additional references

Command-Line Syntax Key