Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Shutdown 1

Status
Not open for further replies.

RebeccaLynn

Programmer
Nov 17, 2003
250
US
can anyone tell me what file is used to shut down windows?


Becca

Somtimes, the easy answer is the hardest to find. :)
 
It is an API of Windows called ExitWindowsEx, containing these calls:

internal const int EWX_LOGOFF = 0x00000000;
internal const int EWX_SHUTDOWN = 0x00000001;
internal const int EWX_REBOOT = 0x00000002;
internal const int EWX_FORCE = 0x00000004;
internal const int EWX_POWEROFF = 0x00000008;
internal const int EWX_FORCEIFHUNG = 0x00000010;

and sourced from Shell32.dll.

The process can be called at the comand line by using shutdown.exe.
[tt]
SHUTDOWN [options] [-m [\\ComputerName]]

options
-M \\Computer : A remote computer to shutdown.
-L : logoff current user

-c "Msg" : An optional shutdown message
-S : Shutdown
-R : Shutdown and reboot
-A : Abort a system shutdown during the timeout period.
-T:xx : Set the timer for system shutdown in seconds.[20 sec. default]
-F : Force running applications to close.

-d u:xx:yy : List a USER reason code for the shutdown.
-d P:xx:yy : List a PLANNED reason code for the shutdown.
xx Specifies the major reason code (0-255)
yy Specifies the minor reason code (0-65536)
[/tt]
 
Thank you, this will help me a lot.


Becca

Somtimes, the easy answer is the hardest to find. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top