tags:

views:

127

answers:

3

Hi!

Is it possible to "hard" restart Windows, without waiting for closing applications, etc.?

+4  A: 

At the command prompt:

SHUTDOWN -r -t 01
Darin Dimitrov
If it's elevated you can run shutdown.exe /f /r /t 0
Mark Allen
+1 The first idea of mine. However this command will also wait for closing applications :(
Danny Chen
Perhaps you should ask yourself why Windows waits for the programs to close.
Lasse V. Karlsen
The /f parameter forcefully closes the applications, but it does not sound like a safe idea.
Johann Blais
+2  A: 

Try http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/8a8bbd4b-9a80-4785-afc7-1e8e6daa3d42. Call ExitWindowsEx with EWX_REBOOT and EWX_FORCEIFHUNG.

andrei m
A: 

As an alternative to the SHUTDOWN tool command, to eliminate completely the waiting time for closing applications, under HKEY_CURRENT_USER\Control Panel\Desktop, set WaitToKillAppTimeout value to 0, and set AutoEndTasks value to 1,

WaitToKillAppTimeout value determines how long the system waits for user processes to end after the user attempts to log off or to shut down Windows. When the time specified in this entry expires, the End Task dialog box appears, stating that the process did not respond. If the value of AutoEndTasks is 1, the system ends the process automatically.

The trick here is to manipulate the registry value-data of both value-names before calling ExitWindowsEx(), and schedule a task that will restore the value-names to their original value-data on the next restart of Windows.

Vantomex