Name

InitiateSystemShutdown( )

Synopsis

Initiates a shutdown and optional restart of the specified computer.

InitiateSystemShutdown(machineName, message, timeout, bForceAppsClosed, bReboot)

Parameters

machineName

The network name of the machine to shut down or None for the current machine.

message

A string that specifies a message to be displayed in the shut-down dialog box or None for no message.

timeout

An integer that specifies the time in milliseconds to display the dialog. During this period, the shutdown can be aborted by calling AbortSystem-Shutdown(). If this value is zero, no dialog is shown, and the shutdown begins immediately.

bForceAppsClosed

An integer that specifies if applications should be forced closed. If true, users aren’t given an opportunity to save their work.

bReboot

An integer that specifies if the machine should be restarted after shutdown or left in a state safe to power off the computer.

Comments

To shut down the local computer, the calling process must have the SE_SHUTDOWN_NAME privilege. To shut down a remote computer, the calling process must have the SE_REMOTE_SHUTDOWN_NAME privilege on the remote computer.

Get Python Programming On Win32 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.