Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Shutdown and reboot from NT4
Message
De
14/04/1999 01:35:18
 
 
À
12/04/1999 04:19:41
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00207365
Message ID:
00208095
Vues:
26
>I am looking for the OCX that can shutdown and reboot from client,
>I use NT4 and the language is VB6 .. any suggestion will be highly appreciated
>

I'd look at using the API call ExitWindowsEx(); be aware that user permissions can prevent an application from doing much more than forcing the user to log out directly. Your best bet would be to use the EWX_REBOOT and EWX_FORCE flags for the first argument. The user and process must have the SE_SHUTDOWN_NAME privilege granted to make the system reboot; another API call, AdjustTokenPrivileges(), can be used to grant the permission to the process if the user has sufficient system privileges. See the MSDN documentation on ExitWindowsEx() and AdjustTokenPrivileges() to get all the gory details.

Short of that, under NT you can use the command line utility SHUTDOWN.EXE that ships with the WinNT Resource Kit. If you've installed it, SHUTDOWN /r will force a system to reboot. Try http://www.ntfaq.com for more information on shutting down NT systems.

>regards
>Winan
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform