I found this on a batch file group and it does work considerably faster than using ExitWindowsEx,EWX_SHUTDOWN or EWX_FORCE,1.
Is there a way to have the program simulate the Ctrl key and see if it can achieve the same fast shutdown?
Thanks.
I recently read elsewhere of this very fast XP shutdown method:
in Task Manager select "Shut Down", hold down Ctrl key, click "Turn
Off".
The machine will shut down in about 3 seconds.
Can this be implemented in a command line sequence or batch file?
No problem starting Task Manager via a batch of course, but how to
then issue the "Shut Down / Control / Turn Off" sequence?
Thanks for your help.
link:
http://www.techgodown.com/how-to-shut-down-your-windows-xp-really-fast/
Is there a way to have the program simulate the Ctrl key and see if it can achieve the same fast shutdown?
Thanks.
I recently read elsewhere of this very fast XP shutdown method:
in Task Manager select "Shut Down", hold down Ctrl key, click "Turn
Off".
The machine will shut down in about 3 seconds.
Can this be implemented in a command line sequence or batch file?
No problem starting Task Manager via a batch of course, but how to
then issue the "Shut Down / Control / Turn Off" sequence?
Thanks for your help.
link:
http://www.techgodown.com/how-to-shut-down-your-windows-xp-really-fast/
Sure, if you call NtShutdownSystem(2) from ntdll. Note, you need to enable SE_SHUTDOWN_NAME privilege before calling this function. The '2' parameter is for ShutdownPowerOff:
enum SHUTDOWN_ACTION {
ShutdownNoReboot = 0,
ShutdownReboot,
ShutdownPowerOff
};
I tried this, but it said "syntax error.
invoke NtShutDownSystem(2),
invoke NtShutDownSystem(2),
invoke NtShutDownSystem, 2
To call it directly, you need to link with ntdll.lib (use includelib). If you do not have ntdll.lib, use
.data
szNtdll: db "ntdll.dll",0
szNtShutDownSystem: db "NtShutDownSystem",0
.code
invoke GetModuleHandle, offset szNtdll
and eax,eax
jz error
invoke GetProcAddress, eax, offset szNtShutDownSystem
push 2
call eax
Thanks.
Andy
Andy
Sure, if you call NtShutdownSystem(2) from ntdll. Note, you need to enable SE_SHUTDOWN_NAME privilege before calling this function. The '2' parameter is for ShutdownPowerOff:
enum SHUTDOWN_ACTION {
ShutdownNoReboot = 0,
ShutdownReboot,
ShutdownPowerOff
};
Where in my code would I put this enum?
Thanks.
I guess you should read about what enums are.
From what I read, I would make the enums as equates starting with 1.
I did so, but the compiler still can't recognize NtShutDownSystem.
Andy
You mean NtShutdownSystem?
I looked thru IDA asm file and was able to reconstructed it.
push 2
call NtShutdownSystem
push 0
push 2
call NtShutdownSystem
push 0