automatically restarting in Ms-DOS mode

Posted on 2004-11-17
Last Modified: 2013-12-28
Is there a way to close Windows 98 with a single click and then having the computer restart in MS-DOS mode ??

I know about the commands:

rundll.exe user.exe,exitwindows
rundll.exe user.exe,exitwindowsexec

which are resp. shutting down the computer/restarting Windows 98.

Would there be a similar command to shut down Windows followed by the computer restarting in MS-DOS ??
Question by:sebastianemborg
    LVL 1

    Accepted Solution

    There are a couple ways to possibly solve this. One, go into your system BIOS and configure it on the tab about booting up. You can also on he start menu click "Shut down" and pick "restart in MS-DOS mode". One of these should work.

    Author Comment


    But what I really want is the "one-click"-option. I am creating a program which is build up on batchfiles and regfiles which can both be run from Windows 98.

    It is a bunch of html-files compiled in a e-book (exe-file).

    However, at one point the user will have to delete some windowsfiles and replace them with some newer versions. These files (Oleaut32.dll and Comctl32.dll) can only be deleted and copyed to Windows in MS-DOS outside Windows 98.

    I am just looking for the "fancy" solution: Instead of instructing the user to choose "start - Shut Down - Restart in MS-DOS mode", they could make a simple click. That would be nice, but if it cannot be done in a simple manner, it is probably better to use the standard way of restarting in MS-DOS.
    LVL 41

    Assisted Solution

    try this create a batch file and use this
    start C:\windows\"exit to dos.pif"
    LVL 1

    Expert Comment

    I dont think there is a way but you could possibly make it a shortcut on your keyboard or you could go in start, Run then type "command" which will bring u to the desktop dos prompt so then in the dos prompt type prompt which will hopefully give you dos. By the way im 13.
    LVL 59

    Assisted Solution

    I forget where I copied this from:

    How would you like to EXIT, SHUTDOWN, POWEROFF, LOGOFF, RELOAD, RESTART or REBOOT Windows 95/98/ME FAST, with 1 mouse click, without the pain of going through the default 4 steps procedure: click the Start button -> click "Shut down" -> check the "Shut Down" or "Restart" box -> finally click the Yes/OK button? I know you would, 'cuz I did too... :) So here is how you do it:

    Left-click on (highlight) an empty Desktop spot -> right-click on it -> choose New -> select Shortcut from the drop down menu.

    In the Command line box copy & paste (Windows 98/ME only):
    RUNDLL32.EXE SHELL32.DLL,SHExitWindowsEx #

    The # flag can be any integer number between -1 and 9. Depending on the particular value substituted as parameter on the command line above, you can force Windows 9x/ME to carry out one of the following actions:

    -1 = Reload Shell: close and then restart the Windows graphical shell [which by default is Windows Explorer (Explorer.exe), located in the main Windows folder] or whatever other (eventually 3rd party) shell executable you are using on the SYSTEM.INI "shell=" line, under the [boot] section. This option may prove useful for recovering from an Explorer or Kernel crash, i.e. an irrecoverable GPF (General Protection Fault) or BSOD (Blue Screen Of Death).

    0 = Logoff (similar to the Start Menu Logoff button): terminate all running processes/threads/executables/TSRs and close all open programs, then log off the current user and then restart the Windows graphical shell.

    1 = Shutdown: terminate all running processes/threads/executables/TSRs and close all open programs, then shut down the Windows GUI to the native/real/true/pure MS-DOS mode and then display the "It is safe to turn off the computer" graphical message on the screen, ONLY IF the Logos.sys file is present in the main Windows folder, otherwise it may [or may not :(] show this message as plain text at the MS-DOS prompt.

    2 = Reboot (similar to the Shutdown Menu Restart button): terminate all running processes/threads/executables/TSRs and close all open programs, then shut down the Windows GUI and then "cold" reboot the computer to the BIOS POST screen and then restart the Windows graphical shell, ONLY IF: the MSDOS.SYS "BootGUI=1" line is present under the [Options] section, or if the WIN command is present in AUTOEXEC.BAT, or if the WIN command is run from the native/real/true/pure MS-DOS command prompt (Windows 98 ONLY).

    4 = Forced Shutdown (unsafe: may generate data loss!): terminate unconditionally all running processes/threads/executables/TSRs and all open programs without warnings, and without "flushing" the data from the memory cache buffers back to the fixed disk(s), eventually powering off the computer if a supported ATX motherboard is detected.
    Avoid using this option if possible!

    5 = Exit To DOS: the "Exit To DOS.PIF" MS-DOS shortcut (Program Information File) is created ONLY IF using Windows 98 (Microsoft REMOVED completely native/real/true/pure MS-DOS mode from Windows ME!), then close all running processes/threads/executables/TSRs and close all open programs, and then shut down the Windows GUI to the native/real/true/pure MS-DOS mode prompt, which can be "unhidden" by running the MODE CO80 command. Read "2 DOS OR NOT 2 DOS", also in MYTIPS95.TXT [part of W95-11D.EXE], to learn how to do this properly.
    FYI: You CAN regain access to MS-DOS mode if using Windows ME by applying the Unofficial Real DOS-Mode Patch [9 KB, freeware], which modifies COMMAND.COM + IO.SYS (from C:\Windows\Command\EBD) + REGENV32.EXE (from C:\Windows\System) to allow Windows ME to boot to native MS-DOS and use DOS mode startup files (AUTOEXEC.BAT + CONFIG.SYS), the Windows 95/98 style.

    8 = Poweroff (ONLY IF a supported ATX motherboard is detected): terminate all running processes/threads/executables/TSRs and close all open programs, shut down the Windows GUI to the native/real/true/pure MS-DOS mode, then display the "It is safe to turn off the computer" graphical message on the screen (ONLY IF the Logos.sys file is present in the main Windows folder, otherwise it may show this message as plain text at the MS-DOS prompt) and then completely power off the computer (the power cord may need to be unplugged and then plugged back in, in order to bring the power back on), ONLY on PCs with APM (Advanced Power Management) enabled, but this feature needs to be activated beforehand (if supported) in the BIOS Setup menu.

    You can add up some of these actions by using two # flags at the same time for combined effect. Example: 1 + 8 = 9, therefore you can use 9 as command line parameter, in case you wish to perform a Shutdown followed by Poweroff.
    In all these cases except for option 4 (Forced Shutdown) Windows file cache routine safely "flushes" (writes) all data from the memory cache buffers back to the fixed disk(s) to avoid any information loss.
    CAUTION: Older, cheap, low quality, incompatible and/or defective computer hardware components, poorly written software drivers and/or programs may sometimes be responsible for undesirable lockups or data loss during the Windows shutdown/poweroff sequence.

    Or you can use this line with all Windows 95/98/ME releases:
    RUNDLL32.EXE USER.EXE,ExitWindows

    and call it "Shutdown!" or "Poweroff!" if using Win95 B/C OSR 2.1 - 2.5 or Win98/ME, because these OSes perform also a complete poweroff on ATX motherboards supporting this feature.

    For the Windows "Restart!" ("warm" reboot) shortcut (all Windows 95/98/ME releases) use:
    RUNDLL.EXE USER.EXE,ExitWindowsExec

    Note that you canNOT use RUNDLL32.EXE for this last command with Win98/ME because their GUI does NOT support this 32-bit DLL API redirect from the command line, and after all USER.EXE is only a "plain" 16-bit executable. :(

    Click Continue, and name these new shortcuts whatever you like.

    Click Finish.
    From now on, (double)-click on one of the shortcuts created above, and you'll be taken to the plain DOS prompt, back to the GUI, or stare at the black monitor screen in only 1 swift move. :)
    Don't forget to SAVE your work and close ALL open programs FIRST, BEFORE shutting down or restarting Windows!
    LVL 38

    Assisted Solution

    The "Exit to DOS.PIF" shortcut highlighted by stevenlewis and LeeTutor is a good option.  Verify that it is in your C:\Windows folder by doing a file search for *.PIF.  It should be there on a standard windows installation.

    If you weren't aware of this, the .PIF extension is the same to DOS as a .LNK file is to Windows, ie. a shortcut to a file.  In Windows, both of these file types are always hidden.

    All files including shortcuts have "properties" available from the Right-Click menu.  The "properties" for a DOS file that can be used in a "DOS Box" within Windows are normally set to "Suggest MS-DOS Mode as necessary", which means that the program can run in DOS while Windows is running OR in FULL DOS.

    The difference with the "Exit to DOS.PIF" file's advanced properties when compared to the Start Menu's "MS-DOS Prompt" shortcut is that it is set to ONLY Use "MS-DOS" Mode and to use the normal DOS settings when running.  This setting specifies that when you run a program with those settings, it controls all system resources.  Before the program runs, the system closes all other active Windows and MS-DOS programs. When you quit the program, Windows restarts automatically.

    I have used that method, but have settled with the following equally simple method.

    By adding the following lines to the end of C:\MSDOS.SYS file, it will allways shows the F8 Boot menu at startup.  The settings will default to Boot menu Option 1 (Normal Windows Boot) after 7 seconds if there is no user input. It will show the available keys along the bottom of the screen, and won't display the Windows 98 logo while booting.


    The menu options are:

    Option 1. NORMAL
    Full Windows (as long as the lines under the [Options] header say: BootMulti=1 and BootGUI=1
    Option 2. LOGGED. Creates the file C:\Bootlog.txt for troubleshooting investigations
    Option 3. SAFE MODE
    Option 4. Safe mode with network support
    Option 5. Step by Step confirmation. Prompts you whether to perform or miss out certain processes during booting.
    Option 6. Command prompt only.  This is what you want.
    Option 7. Safe mode command prompt only
    Option 8.  Previous version of Operating system if system is a dual-boot one.

    So, if you edit those extra lines in MSDOS.SYS to:


    the system will wait 7 seconds for user input before booting into DOS.

    I use a shortcut (named "restart" on my desktop set to the command line:

    C:\WINDOWS\RUNDLL32.EXE shell32,SHExitWindowsEx 2

    I use constantly and am always present when the Boot menu is shown, so I can easily boot to Windows.  7 seconds really isn't that much of an unwanted delay to live with.

    Try both methods and see if there is any difference between the expected results.

    As an extra pice of interesting information, if your intention is a quick reboot to DOS for gaming, then you should also find 2 other .PIF files in the C:\Windows folder named:

    MS-DOS Mode for Games
    MS-DOS Mode for Games with EMS and XMS Support

    Kind of long file names riddled with spaces for DOS commands, but the names describe the intended uses of them and they are only examples about tailoring the DOS environment to suit the needs.  You could, if you wished, boot into DOS in a way that suited DOS games by calling a .PIF file containing those settings.

    See here:

    Author Comment

    Thank you for all your suggestions.

    I will be looking into them tonight (it's morning here in Europe).

    Author Comment

    It took some time for me to work through all this lovely information, but here I am...

    We are daeling with a Danish version of Windows 98 (4.10.1998). There is no "exit to DOS.pif"-shortcut anywhere, but there are two shortcuts to "DOS-games". And clicking on these shortcuts does take you to a DOS-promt (which could be the solution to what I am looking for). Only these two shortcuts with very long filenames are entering DOS a little differently than the Start - Shut Down - Restart in MS-DOS"-option. The keyboard is not Danish (as in the "normal" way of entering MS-DOS from Start Menu in Windows), which means that some keys are configured wrongly from a Danish point of view.

    The option from Lee (number 5) will strangly enough not restart my computer in MS-DOS, but just open a DOS-promt inside Windows.

    I have tried this:

    I made a DOS-shortcut on the desktop with this command:

    C:\ (or C:\Windows\

    Then I rightclicked the DOS-icon and went to "Program - Advanced" and marking the third option "MS-DOS-something" and "Use the current MS-DOS configuration".

    Now clicking on this shortcut does exacty what I want it to do: Closing Windows and starting in MS-DOS (not inside Windows and this time with the Danish keyboard). Excatly as if I used the "Start - Shut Down - Restart in MS-DOS"-option.

    Now I am wondering: The two settings I changed in the DOS-shortcut, must be changing something somewhere in Windows, since the shortcuts default value (opening a DOS-promt inside Windows) has been changed. As the 1 to 9 options from Lee (which I think I located in the Registry) doesn't do the job on my computer, it must be something else - a commandline of some kind.

    I can easily live with the normal way of restarting in MS-DOS, but now I'm curious to figure out the command line. The configured DOS-promt shows that it must be possible to make this one click option, so I will look on. Maybe the Danish windows differs from the English/US versions in some way...

    Author Comment

    I may have found something:

    Still eager to read your comments :-)
    LVL 41

    Expert Comment

    LVL 38

    Expert Comment

    Also discussed in the KB article here:

    Author Comment

    Thank you, guys. How do I tecnically divide the points between more than one answer?  
    LVL 41

    Expert Comment

    Can I split the points?

    Yes. Scroll down to the bottom of the question, just above the text box, and click the "Split Points" link. Select the radio button of the comment who you want to Accept as the Accepted Answer. Only one button can be selected. Set the point value (a text box above the comment) of how much you want this person to receive of the points. Then set the point values for each of the experts comments to whom you want to allocate points and these will be considered Assisted Answers in helping you resolve the issue. Double check your information and then click the Submit button at the bottom of the page. One note: the total points of the splits must equal the amount you asked the question for itself, and no person can receive fewer than 20 points.

    Author Comment

    I hope I did it right... :-)
    LVL 38

    Expert Comment

    Jeg kan kun tale en lille smule Dansk... Tak  :-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why do Marketing keep bothering you?

    Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

    Update 11/3/2014 - Although the below article will get you to relocate the WINSXS folder, Microsoft has finally released a utility to reduce the size of the WINSXS folder. For some reason, it's not that straightforward. It only works on Windows 2008…
    Join Greg Farro and Ethan Banks from Packet Pushers ( and Greg Ross from Paessler ( for a discussion about smart network …
    The viewer will learn how to download, install and use CrashPlan from on Windows 7. Open your browser and go to Click get started, it’s free then Click the Download CrashPlan button: Click save in Internet Explorer, the…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now