Results 1 to 2 of 2

Thread: Shutdown NT / Win2000

  1. #1

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544

    Question

    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!!!
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  2. #2
    Guest
    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]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width