WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Reboot and Shutdown Topics

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Restarting windows

Keywords:    restart windows window command boot reboot	 Unconditionally Restart Windows

Question:

In the WinBatch compiler is it possible to restart windows? I know it is possible to terminate windows with EndSession, but I haven't been able to find a way to restart windows.

Answer:

The "EndSession" function logs the current user out of the session, and starts a new session. If there is no password to type, it basically drops straight into a new session.

If you want to shutdown the computer, reboot, etc etc, look at the IntControl functions. Check out IntControls 66, 67 and 68

To Restart Windows...

   IntControl(66,0,0,0,0) 

To Reboot your Machine...

  IntControl(67,0,0,0,0)
This is a bit obscure, but it indeed works.

Unconditionally restarting Windows:

Is there a way to Unconditionally Restart Windows no matter what programs are currently running? For example, I tried:
        IntControl(12,5,0,0,0)
        IntControl(67,0,0,0,0)
but, if Notepad is running with an unsaved document, I get asked if I want to save the document, and then Windows doesn't shut down and restart.

I have seen other programs do this, but I'm not sure how to do it with winBatch.

Answer:

	IntControl(67,0,1,0,0)
Note the FORCE parameter.
Article ID:   W13320
Filename:   Restarting windows .txt
File Created: 2001:01:03:14:20:56
Last Updated: 2001:01:03:14:20:56