Shut Down
Verfasst: 25.03.2010 21:11
gibt es einen shut down befehl der den pc runter fährt?
Quelle: http://www.purebasic.fr/german/viewtopi ... 42#p122242Fluid Byte hat geschrieben:Code: Alles auswählen
Procedure ExitWindows(Flags.l) Protected tkp.TOKEN_PRIVILEGES Protected tkpNewButIgnored.TOKEN_PRIVILEGES OpenProcessToken_(GetCurrentProcess_(),#TOKEN_ADJUST_PRIVILEGES | #TOKEN_QUERY,@hdlTokenHandle) ; Get the LUID for shutdown privilege. LookupPrivilegeValue_(0,"SeShutdownPrivilege",tkp\Privileges\Luid) tkp\PrivilegeCount = 1 ; One privilege to set tkp\Privileges\Attributes = #SE_PRIVILEGE_ENABLED ; Enable the shutdown privilege in the access token of this process. AdjustTokenPrivileges_(hdlTokenHandle,0,tkp,0,0,0) ExitWindowsEx_(Flags,0) EndProcedure ExitWindows(#EWX_SHUTDOWN)
Code: Alles auswählen
RunProgram("shutdown.exe","-s -t 0 -f","",0)