Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Force ShutDown and Restart
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00143339
Message ID:
00145886
Vues:
34
Well, it doesn't work in this raw form - I'll have to investigate how to modify the SE_SHUTDOWN_NAME privilege.

>>I could have sworn I saw a KB article around here on how to force an NT system to shut down and restart.
>>
>>I have an application that runs 24x7, and I'm experiencing odd troubles with it. I suspect a memory leak, and I just want to have the app shut down and restart WinNT every morning at 3:00 or something.
>>
>>Other apps will be running, but I suspect they will respond to the Windows shutdown message.
>>
>Hi Michael,
>
>I don't know if this'll do it on NT, but try the following:
>#DEFINE EWX_REBOOT   2
>DECLARE SHORT ExitWindowsEx IN Win32API;
>  SHORT uFlags, INTEGER dwReserved
>= ExitWindowsEx(EWX_REBOOT, 0)
>According to the documentation on NT, "The calling process must have the SE_SHUTDOWN_NAME privilege....To shut down or restart the system, the calling process must use the AdjustTokenPrivileges function to enable the SE_SHUTDOWN_NAME privilege."
>
>hth,
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform