Computer Games Forum

Go Back   Computer Games Forum > Tech > Software

Notices

Reply
 
LinkBack Thread Tools
Old 25-05-2001, 12:32   #1 (permalink)
Paranoia is natural
 
Join Date: Nov 2000
Location: Bucuresti
Shutdown

Cum fac pe windows 95, 98, NT sau 2k un reboot din linie de comanda??
__________________
Those people who think they know everything are a great annoyance to those of us who do.
 
AStateOfMind is offline    Reply With Quote
Old 25-05-2001, 15:00   #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 actiunea

Uite 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
 
Iulika0069 is offline    Reply With Quote
Old 31-05-2001, 04:32   #3 (permalink)
Registered User
 
Slider's Avatar
 
Join Date: Dec 1999
Location: A nearby parallel Universe...
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.
 
Slider is offline    Reply With Quote
Old 31-05-2001, 09:48   #4 (permalink)
Paranoia is natural
 
Join Date: Nov 2000
Location: Bucuresti
nici mie, tot in NT , eram admin.
__________________
Those people who think they know everything are a great annoyance to those of us who do.
 
AStateOfMind is offline    Reply With Quote
Advertisment
Reply

  Computer Games Forum > Tech > Software

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +2. The time now is 15:30.


This site is copyrighted ©1997 - 2009, Computer Games Online SRL