Restart Action Icon

Restart

Declaration

<AMRESTART FORCE="YES/NO" PROMPT="YES/NO" DELAY="number" MEASURE="text (options)" MESSAGE="text" COMPUTER="text" />

See Also

Lock Workstation | Log Off | Restart | Shut Down | Suspend/Hibernate | Empty Recycle Bin | End Process | Change Printer | Print | Set Date and Time | Run | Block Input | Generate Password

Description

Restarts the computer. On Windows NT/2000/XP any computer on the network may be specified. Windows 95/98/ME supports restarting the current machine only.

Practical Usage

Example 1: Administrators could create and deploy a task with this action to force restart the system after an automated installation or file update has taken place.

Example 2: After modifications are made to the registry using the Registry action, the system could be restarted to allow the changes to take effect on the system.

Parameters

General Properties

Property

Type

Req'd

Default

Markup

Description

Restart local machine

 

 

 

 

If enabled, indicates that the local machine will be restarted. This visual mode parameter contains no markup and only available during design time. It is enabled by default.  

Restart a remote computer

 

 

 

 

If enabled, specifies that a remote computer will be restarted. This visual mode parameter contains no markup and only used during design time. If this parameter is enabled, the Restart local machine parameter is ignored.

Computer to restart

Text

Yes

(Empty)

COMPUTER="COMPUTERNAME"

The computer name to restart. This can be any valid computer name on the Windows network. In visual mode a drop-down is provided for convenience in selecting a machine name. If not specified, the current machine is assumed. AutoMate must also be running under a user account that has privileges/rights to shut down other machines (such as an administrator account). Active only if the Restart a remote computer parameter is selected.

Prompt user to log off

Yes/No

No

No

PROMPT="YES"

If set to YES, specifies that Windows should display a dialog to the user with a countdown notifying that the system is about to be restarted in order to give the user time to save his/her work. Active only if the Restart a remote computer parameter is selected.

NOTE: Due to operating system limitations this parameter is not supported on Windows 95/98/ME systems.

Shutdown after

Number

No

5

DELAY="6"

Used in combination with the Measure parameter to specify the total amount of time that Windows should delay before shutting down. This parameter is active only if the Prompt user to log off parameter is set to YES.

NOTE: Due to operating system limitations this parameter is not supported on Windows 95/98/ME systems.

Measure

Text (options)

No

seconds

MEASURE="minutes"

Specifies the time measure that should be used in combination with the value entered in the Shutdown after parameter. This parameter is active only if the Prompt user to log off parameter is set to YES. The available options are:

  • Milliseconds

  • Seconds (default)

  • Minutes

  • Hours

Message to display in the shut down dialog box

Text

No

(Empty)

MESSAGE="Please begin to panic now"

A user-defined message that windows should display on the restart notification dialog. This parameter is active only if the Prompt user to log off parameter is set to YES. The message will be displayed for the number of seconds, minutes or hours specified in the Shutdown after  parameter.

NOTE: Due to operating system limitations this parameter is not supported on Windows 95/98/ME systems.

Force the system to shut-down without notifying applications

Yes/No

No

No

FORCE="YES"

If set to YES, Specifies that the system should shut down immediately without notifying and waiting for applications to return that they are ready to close. This parameter is set to NO by default.

 

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Example 1 - Restart a remote computer

 

<AMRESTART FORCE="YES" PROMPT="YES" DELAY="6" MEASURE="minutes" MESSAGE="This computer will shut down soon." COMPUTER="COMPUTERNAME" />

 

 

Example 2 - Restart the local computer

<AMRESTART />

↑ Top of Page