Results 1 to 5 of 5

Thread: restart this computer now!!!

  1. #1

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    Lightbulb

    I can i restart a computer within a vb program.

  2. #2
    Junior Member
    Join Date
    Aug 2000
    Posts
    27
    Code:
    in a module:
    
    Option Explicit
    
    Public Declare Function ExitWindowsEx Lib "user32" (ByVal _ uFlags As Long, ByVal dwReserved As Long) As Long
    
    Public Const EWX_SHUTDOWN = 1
    Public Const EWX_LOGOFF = 0
    Public Const EWX_REBOOT = 2
    Public Const EWX_FORCE = 4
    
    in a form:
    
    Private Sub Command1_Click()
    ExitWindowsEx EWX_REBOOT, 0
    End Sub

  3. #3
    Guest
    Vb2000, is there anyway of logging out of a remote PC in VB? Or logging in for that matter?

  4. #4
    Guest
    What I'm looking for is to be able to pass the function a computer on the network and logoff that PC. For example, from Computer 'A' I want to log the user off Computer 'B'.

  5. #5
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    You would have to set up service on each computer on the network. Then, use the winsock control to allow a Client program to connect to the service and log him of
    Use:
    Code:
    ExitWindowsEx (EWX_LOGOFF, 0)
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

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