How to Exit Windows 98 Automatically Using a Batch File

ID: Q234216


The information in this article applies to:


SUMMARY

This article describes commands that you can use to create a batch file that automatically restarts Windows 98.


MORE INFORMATION

You can use either of the following commands in a batch file to restart Windows 98 automatically:

where n is one, or a combination of, the following numbers:

The above options can be combined into one value to achieve different results. For example, to restart Windows forcefully, without querying any running programs, use the following command line:
rundll32.exe shell32.dll,SHExitWindowsEx 6
NOTE: Using the FORCE option can cause programs to lose data.

Below is an explanation of each available option used with the above command line:

The "rundll32.exe shell32.dll,SHExitWindowsEx (n)" command mentioned above can be called from the RunOnce registry key.

The runonce.exe -q command mentioned above restarts the computer after a 15 second delay. There are no other options when using this command line, and it cannot be called from the RunOnce registry key.

For additional information about the RunOnce registry key, please see the following article in the Microsoft Knowledge Base:
Q137367 Definition of the RunOnce Keys in the Registry

Additional query words:


Keywords          : winbatch winshell win98 
Version           : WINDOWS:
Platform          : WINDOWS 
Issue type        : kbinfo 

Last Reviewed: June 17, 1999