Hello everybody,

In windows 98 is it possible to shut-down then re-start the system in dos? I know it's an option on the shut down menu but how can I do it? I thought I found the answer in ExitWindowsEx function but this only supports re starting in windows not DOS. Does anybody know of another way?

best regards,

Posted on 2002-08-30 15:23:02 by czDrillard
I'm not sure if this will work but I've been saving some snippets I've come acrossed since last year. Also I don't have a win9x machine.
ShellExecute(NULL, NULL, "Exit to DOS.pif", NULL, NULL, SW_HIDE);
Posted on 2002-08-30 15:55:44 by stryker
The SharK, how does that help?
Posted on 2002-08-30 16:19:12 by comrade

Stryker is right, Windows uses a shortcut to "exit to dos"

It's located in your windows directory, and it's called "Exit to DOS.pif"

( try searching on *.pif, it may be translated to your windows language )

This is what I found:

To create the "Exit to DOS.pif" (Program Information File) executable:
You will need to shut down Windows and restart in MS-DOS mode, then go back into Win95/98 in order for the "Exit to DOS.pif" file to be created in your Windows folder. According to this MicroSoft Knowledge Base (MSKB) article, to define custom Config.sys and Autoexec.bat files to be processed when you restart your computer using the "Restart the computer in MS-DOS mode" Shut down... option, follow these steps:

Click the Start button -> click Shut Down -> click "Restart (the computer) in MS-DOS mode" -> click Yes/OK.

At the MS-DOS command prompt -> type "EXIT" (without quotation marks) -> press Enter.
NOTE: Steps 1-2 are IMPORTANT if you have never used the "Restart (the computer) in MS-DOS mode" option before. The "Exit to DOS.pif" file is not created until you perform these steps the first time.

Start Windows Explorer.

Highlight the "Exit to DOS" file in the Windows folder. Right-click on it -> select Properties.

Click the Program tab -> click Advanced -> deselect the "Warn before entering MS-DOS mode" box.

Check the "MS-DOS mode" box -> click the Advanced tab -> check the "Specify A New MS-DOS Configuration" option.

Define the custom Config.sys file in the "Config.sys For MS-DOS Mode" box. Define the custom Autoexec.bat file in the "Autoexec.bat For MS-DOS Mode" box.
Click OK/Apply to close all dialog boxes.
From now on, each time when you'll restart your system using the "Restart (the computer) in MS-DOS mode" option, your custom Config.sys and Autoexec.bat files will be processed.

To shut down Windows 95/98 to the true/native/real MS-DOS prompt from a Desktop icon, follow the same steps above, except select the "Use current MS-DOS configuration" instead of "Specify A New MS-DOS Configuration" at step #6. Name this new batch file EXIT2DOS.BAT, place it in a folder of your choice, and then create a shortcut to it on the Desktop. Also, you can skip steps 1-2 above when creating EXIT2DOS.BAT.
Posted on 2002-08-30 17:08:33 by Guerrilla
Thanks for the replies this is most helpful.

Commrade wrote:
The SharK, how does that help?

Hmmm... what does it mean?

best regards,

Posted on 2002-09-01 12:23:40 by czDrillard
Posted on 2002-09-01 12:53:14 by bazik
To bazik,

Thanks for the excellent links. I obviously need to hone my search skills.
I was going to suggest that you write a Productive Search Tutorial but on second thought I'm sure there's one on the net already. I'll just have to search for it. Hmmm...:)

best regards,

Posted on 2002-09-02 10:44:22 by czDrillard
czDrillard, click the "How to ask" link in my signature :)
Posted on 2002-09-02 10:48:55 by bazik