Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I force a reboot on app exit?
Message
De
11/02/1999 13:16:51
 
 
À
11/02/1999 12:29:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00186106
Message ID:
00186649
Vues:
13
>>I put this code into xboot.prg and then ran it... nothing happened.
>>
>>Is there more I need to know / do?
>>
>>Thanks
>>
>>>>I need to lock a PC so that it runs my app on startup and reboots when my app exits...
>>>>
>>>>Any ideas?
>>>
>>>DECLARE INTEGER ExitWindowsEx IN WIN32API INTEGER uFlags, INTEGER nReserved
>>>ExitWindowsEx(2 + 4 + 16, 0)
>>>
>
>It worked on the machine I tested at home; try using 6 (drop the ForceIfHung flag, 0x10, from the flag mix) rather than 22, since that might not be in whatever version of the API you're using. It's a relatively late addition to the API.

I just checked - under NT, even a privileged user, without the necessary permissions can only force a logout; you can't force a shutdown or reboot unless the user has the Shut Down The System explicitly granted; the best you can do is force a logout. This is normally only granted to Administrators and Server Operators; Domain Administrators do not get this by default.
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