There is a way to reboot, but I only know how to do it programatically: ExitWindowsEx(EWX_FORCE | EWX_REBOOT ,0);
[from the help] Forces processes to terminate. When this flag is set, Windows does not send the messages WM_QUERYENDSESSION and WM_ENDSESSION to the applications currently running in the system. This can cause the applications to lose data. Therefore, you should only use this flag in an emergency. There are some problems with this though. Like the help says, reserve it for emergency, like for after you try to shutdown and can't. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Matt Swift Sent: Tuesday, March 05, 2002 16:46 To: [EMAIL PROTECTED] Subject: shutdown gotcha with Win32 host When running VNC as a service on Win2k, one can reboot the host machine via the remote client. The machine reboots, the service runs, and one can reconnect with the client, log in, and so on -- *unless* during the shutdown process Windows encounters a program that it cannot close (most notably, any Cygwin bash shell). Windows then puts up a popup window asking the user to confirm a more forceful kill of that program. The sequence of events in this case is the following: select reboot on host VNC host closes client connection Windows encounters a problem process and requests user input In this state, the VNC host responds to attempts to reconnect with a client, but after authentication immediately drops them, with a message to the effect that the connection was dropped because a shutdown is in process. The result is the inconvenient necessity, when rebooting a host remotely, to kill as many processes as possible manually, to avoid the possibility of locking oneself out of the system permanently, until one can visit the actual remote machine and manually confirm to Windows that it may kill that dratted Cygwin shell (or other process). There is more than one way to address this problem -- and probably more than one way ought to be pursued. Is there a way to invoke an "unconditional reboot" in Win2k that I do not know about? There will always be a risk of a "stuck" process, so if there is not a way to ask Windows to reboot unconditionally, then I think VNC ought to let clients connect when a shutdown is in process. I do not understand the reason it declines to accept connections, but whatever it is, I would be surprised if it applies in the circumstances described, and would be surprised if the negative consequences of allowing a connection are as dire as the consequences of declining one. Any insight or suggestions will be greatly appreciated. --------------------------------------------------------------------- To unsubscribe, mail [EMAIL PROTECTED] with the line: 'unsubscribe vnc-list' in the message BODY See also: http://www.uk.research.att.com/vnc/intouch.html --------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, mail [EMAIL PROTECTED] with the line: 'unsubscribe vnc-list' in the message BODY See also: http://www.uk.research.att.com/vnc/intouch.html ---------------------------------------------------------------------
