-
I'm trying to shutdown windows 2000 from my vb application, but It doesn't seems to be working!
I'm using the ExitWindowsEx API:
Option Explicit
Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Public Const ewx_shutdown = 1
Public Const ewx_restart = 2
Public Const ewx_logoff = 4
Private Sub Command1_Click()
Call ExitWindowsEx(ewx_shutdown,1)
End Sub
This doesn't work, but when I try to logoff, it is working fine!!!
-
Hello,
Your going to have to do some more research.
I found this referance in the MSDN Library
Under the Platform SDK: Windows System Information
ExitWindowsEx
Windows NT/2000: To shut down or restart the system, the calling process must use the AdjustTokenPrivileges function to enable the SE_SHUTDOWN_NAME privilege. For more information about security privileges, see Privileges
copyright MSDN April 2000
Hope this helps a little,
[Edited by RvA on 05-27-2000 at 09:15 AM]