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: W13000Filename: Restarting Windows .txt