Results 1 to 3 of 3

Thread: Restart Without Prompt

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Thessaloniki ,Greece
    Posts
    100

    Post

    I have a problem ... i want to restart my computer when the widnows stuck...and i can't do anything...
    I have make a program that can restart your computer but windows responce a message to end task some programs.
    How can i make the end task automatically and restart the computer.
    This solves my problem to make reboot to a host computer that is away from me and i get in with Pc-Anywere 9.0.


  2. #2
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544

    Post

    Add a module to the project and type:

    Option Explicit
    Declare Function ExitWindowsEx Lib "user32" Alias "ExitWindowsEx" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long

    Public Const EWX_REBOOT = 1

    Add the following code to Form1

    Private Sub Form_Load()
    Call ExitWindowsEx(EWX_REBOOT, 1)
    End Sub


    ------------------
    Yours sincierly
    CyberCarsten http://home18.inet.tele.dk/cyber/
    [email protected]


    [This message has been edited by CyberCarsten (edited 01-22-2000).]

  3. #3
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Leeds, UK
    Posts
    287

    Post

    Hi,

    I just added all this code to my form:

    -----------------------------------------
    Private Declare Function ExitWindowsEx Lib "Kernel32" (Byval uFlags as Long, Byval dwReserved as long) As Long

    'Add this to an event..
    ExitWindowsEx EWX_REBOOT Or EWX_FORCE, 0
    -----------------------------------------

    hope it helps!

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