![]() |
| | #2 (permalink) | ||
| Registered User Join Date: Jan 2001 Location: Bucharest, Romania |
Pt ShutDown ai putea incerca x:\windows\rundll32.exe user.exe,ExitWindows respectiv x:\winnt\system32\rundll32.exe user.exe,ExitWindows dintr-un .bat . Mare atentie sa nu fie spatiu unde e virgula Pt Restart nu cred ca merge ...,RestartWindows Problema este la 2k sau NT, ca nu cred ca merge secventa de mai sus (sa verific ), pt. ca trebe sa dai drepturi de shutdown la procesul care initiaza actiuneaUite un programel in VC++: // ShutDown.cpp : Defines the entry point for the application. // //#include "stdafx.h" #include "windows.h" int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // TODO: Place code here. HANDLE hToken; TOKEN_PRIVILEGES tkp; // Get a token for this process. if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)); // Get the LUID for the shutdown privilege. LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tkp.Privileges[0].Luid); tkp.PrivilegeCount = 1; // one privilege to set tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; // Get the shutdown privilege for this process. AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0); // Cannot test the return value of AdjustTokenPrivileges. if (GetLastError() != ERROR_SUCCESS); // Shut down the system and force all applications to close. if (!ExitWindowsEx(EWX_REBOOT /*| EWX_FORCEIFHUNG*/, 0)); return 0; }
__________________ Subject: still none | ||
|
| | #3 (permalink) | ||
|
Mie nu mi-a mers in NT faza cu ExitWindows...
__________________ a.k.a. windmaster... Antec SX 1040BII system enclosure; Intel Pentium III 550E @ 645MHz; MSI 6163 BXMaster; 1.0GB SDRAM PC133; Quantum Fireball CX13.0A+Western Digital Caviar WD800JB+Western Digital Caviar WD400JB; Plextor PX-W4824A+Plextor PX-716A+Toshiba DVD-Rom SD-M1612; Genius SP-G16+Tesla Sound System on Sound Blaster Live! Player 1024; Philips Brilliance 107P20 on Gigabyte Ati Radeon 7000E 32MB DDR; Microsoft Wireless Laser Desktop 6000. | |||
|
![]() |
|
| Thread Tools | |
| |