User Tools

Site Tools


This is an old revision of the document!

A PCRE internal error occured. This might be caused by a faulty plugin

=====Shutting down the PC===== //by Richard Russell, October 2007//\\ \\ It's not a very likely thing to want to do, but the code below **shuts down** the PC when executed. Note that if run under //Windows 2000 Professional//, //Windows XP Professional// or //Windows Vista// it's entirely likely that the system adminstrator will have disabled the ability of ordinary user programs to shut down the PC. In that case the program will fail with the //Cannot acquire Shutdown privilege// message.\\ \\ REM. Caution: this program shuts down the computer! SYS "GetCurrentProcess" TO hprocess% _TOKEN_ADJUST_PRIVILEGES = &20 _TOKEN_QUERY = 8 SYS "OpenProcessToken", hprocess%, \ \ _TOKEN_ADJUST_PRIVILEGES OR _TOKEN_QUERY, ^htoken% _SE_PRIVILEGE_ENABLED = 2 DIM tkp{PrivilegeCount%, Luid{l%,h%}, Attributes%} tkp.PrivilegeCount% = 1 tkp.Attributes% = _SE_PRIVILEGE_ENABLED SYS "LookupPrivilegeValue", "", "SeShutdownPrivilege", ^tkp.Luid.l% SYS "AdjustTokenPrivileges", htoken%, 0, tkp{}, 0, 0, 0 TO ok% IF ok% = 0 ERROR 100, "Cannot acquire Shutdown privilege" _EWX_POWEROFF = 8 SYS "ExitWindowsEx", _EWX_POWEROFF, &FFFF TO ok% IF ok% PRINT "System shutting down...." You may alternatively wish to change the **_EWX_POWEROFF** value to **_EWX_SHUTDOWN** ("=1") which doesn't turn the power off or **_EWX_REBOOT** ("=2") which restarts the system.

This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
shutting_20down_20the_20pc.1522502382.txt.gz · Last modified: 2018/03/31 14:19 by