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

FAQs - Frequently Asked Questions

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

Restarting Windows - Internal Control Functions

Keywords:  restart Windows internal controls warm boot reboot

Question:

How do I restart Windows?

Answer:

WinBatch has several Internal Control functions, IntControl, which permit numerous internal operations. If you are having trouble finding a specific command, you may find a solution here. For example, IntControl can perform a warm boot and restart windows.
	IntControl (66, 0, 0, 0, 0)
In Windows, this function restarts Windows, just like exiting to DOS and typing WIN again: (Could be used to restart Windows after editing the SYSTEM.INI file to change video modes.)

In 32 bit versions, this function logs the user out of the current session:

	IntControl (67, 0, 0, 0, 0)
Performs a warm boot of the system, just like Ctrl-Alt-Del. Could be used to reboot the system after editing the AUTOEXEC.BAT or CONFIG.SYS files.

In 32 bit versions, this function will cause of reboot of Windows 95/NT machines:

	IntControl (68, 0, 0, 0, 0)
Performs a warm boot of the system, just like Ctrl-Alt-Del. Could be used to reboot the system after editing the AUTOEXEC.BAT or CONFIG.SYS files.

In 32 bit versions, will cause a shutdown of the machine, awaiting power off.

How to Resume Processing After Windows Restarts:

After the machine shuts down, the only way to resume is to instruct the machine to run a script at Windows bootup. Something like this might do:

On machine shutdown...

	old=IniRead("windows","run","")
	IniWrite("windows","temprun",old)
	new=strcat(old," c:\temp\restart.wbt")
	IniWrite("windows","run",new)

RegSetValue(@REGMACHINE,"Software\Microsoft\Windows\CurrentVersion\RunOnce[xyzzy17]","c:\temp\restart.wbt")
	IntControl(67,0,0,0,0)
Then your xxx.wbt file should look like...
	BoxOpen("Please Wait","WinBatch Script Running")
	TimeDelay(15) ; let windows get organized
	old=IniRead("windows","temprun","")
	IniWrite("windows","run",old) ; Restore INI file
	BoxShut()
Now do what you need to do on restart...
Article ID:   W13000
Filename:   Restarting Windows .txt
File Created: 2001:01:03:12:07:28
Last Updated: 2001:01:03:12:07:28