Computer - Restart

Declaration

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

Related Topics   

Description

Restarts the computer.

Practical usage

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

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

Parameters

General

Property Type Required Default Markup Description
Local computer --- --- --- --- If enabled, indicates that the local computer will be restarted (enabled by default). This is a visual mode parameter only used during design time, thus, contains no markups. It is enabled by default. If this parameter is enabled, the Remote computer parameter is ignored.
Remote computer Text Yes (Empty) COMPUTER="COMPUTERNAME" If enabled, specifies the name of the remote computer to restart. This can be any valid computer name or corresponding IP address on the Windows network. Automate Desktop must also be running under a user account that has privileges/rights to restart other machines (such as an administrator account). If this parameter is enabled, the Local computer parameter is ignored.
Prompt user to log off Yes/No No No PROMPT="YES" If selected, specifies that a shutdown dialog should be displayed with a countdown notifying the user that the system is about to restart in order to provide time to save his/her work. This parameter is active only if the Remote computer parameter is enabled.
Shutdown after Number No 5 DELAY="6" 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 selected.
Measure Text (options) No seconds MEASURE="minutes" Specifies the time measurement that should correspond with the numeric value entered under the Shutdown after parameter. The available options are:
  • Milliseconds - The value specified in the Shutdown after parameter is measured in milliseconds.
  • Seconds (default) - The value specified in the Shutdown after parameter is measured in seconds.
  • Minutes - The value specified in the Shutdown after parameter is measured in minutes.
  • Hours  - The value specified in the Shutdown after parameter is measured in hours.
Message to display in the shut down dialog Text No (Empty) MESSAGE="System is now shutting down." A user-defined message to be displayed by the shutdown dialog. This parameter is active only if the Prompt user to log off parameter is selected. The message will be displayed for the number of seconds, minutes or hours specified in the Shutdown after  parameter.
Force the system to shut-down without notifying applications Yes/No No No FORCE="YES" If selected, specifies that the system will shut down immediately without notifying and waiting for applications reply that they are ready to close. This parameter is disabled by default.

Description

Error Causes

On Error

Examples

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Example 1

This sample task restarts a remote computer.

Copy
<AMCOMPUTER ACTIVITY="restart" COMPUTER="COMPUTERNAME" PROMPT="yes" DELAY="6" MEASURE="minutes" MESSAGE="This computer will shut down soon" FORCE="yes" />

Example 2

This sample task restarts the local computer.

Copy
<AMCOMPUTER ACTIVITY="restart" />