VOGONS


First post, by assortedkingdede

User metadata
Rank Newbie
Rank
Newbie

Everytime I load DOS mode in windows 98, it reverts my custom autoexec.bat to default and erases my custom configuration so how I can prevent this from happening? Thanks!

Reply 1 of 4, by Errius

User metadata
Rank l33t
Rank
l33t

You need to edit the relevant boxes in 'Exit to DOS.pif'. When you 'restart in DOS' from Windows 98, it copies these fields into CONFIG.SYS and AUTOEXEC.BAT.

When you type 'exit' to return to Windows, these files (including any changes you have made) get deleted and replaced by the Windows versions.

ETA. The above is what happens if you select the "Specify A New MS-DOS Configuration" in Exit to DOS.pif. If however you select "Use Current MS-DOS Configuration", then the lines in C:\Windows\DOSSTART.BAT get added to the Windows AUTOEXEC.BAT on going to DOS. This is quicker but more limited (you cannot change CONFIG.SYS using this method.)

Is this too much voodoo?

Reply 2 of 4, by nobleEightfold

User metadata
Rank Newbie
Rank
Newbie

I haven't figured out the cause behind it but I ran into the same issue where the .PIF file resets every time I right-click and press properties or when the computer is restarted. So I can set the autoexec.bat and config.sys for restarting into DOS mode, then when exiting back to Windows, the custom autoexec.bat and config.sys I set in the .PIF file are gone. The weird thing is it didn't used to do this, so I don't know what's causing it now.

I was able to work around this by setting the .PIF file to READ ONLY in properties after setting autoexec.bat and config.sys. This prevents Windows from doing whatever it's doing to overwrite the custom autoexec and config.

This however means that whatever changes you make to autoexec.bat and config.sys won't be saved after exiting to Windows.

I was able to somewhat workaround this problem by doing the following:

1. setting up autoexec.bat and config sys as I needed and save them as autoexec.BAK and config.BAK.
2. create two batch files:

Batch file 1 - SETCONF.BAT:
COPY /Y C:\AUTOEXEC.BAK C:\AUTOEXEC.BAT
COPY /Y C:\CONFIG.BAK C:\CONFIG.SYS

Batch file 2 - BAKCONF.BAT:
COPY /Y C:\AUTOEXEC.BAT C:\AUTOEXEC.BAK
COPY /Y C:\CONFIG.SYS C:\CONFIG.BAK

3. Add a CALL to the first .bat in the custom autoexec.bat of the .PIF shortcut. - Remember to set READONLY so this call doesn't get erased.
CALL C:\SETCONF.BAT

4. Add a call to the 2nd .bat in the custom AUTOEXEC.BAK file, right before the line that Windows automatically adds to return to Windows when typing EXIT:

REM
REM The following lines have been created by Windows. Do not modify them.
REM
C:
CD C:\
~~~ << This line is whatever command you ran. Personally, mine is CALL C:\LHCMD.BAT which itself just runs LH COMMAND.COM.
CALL C:\BAKCONF.BAT ** Add this line.
C:\WINDOWS\WIN.COM /WX << This line is usually added by windows when there's

By adding this, whenever you type EXIT to return to Windows, then your config and autoexec files will automatically be backed up before returning to Windows. Then next time you run the shortcut, the process happens all over again without Windows mysteriously erasing your autoexec and config.

Hope this helps somebody, or maybe somebody else knows a much simpler way and will share that here. Good luck!

Reply 3 of 4, by nobleEightfold

User metadata
Rank Newbie
Rank
Newbie

I don't see an edit button, sorry for double posting:

I forgot to mention that after running the shortcut, you need to reboot the computer with CTRL-ALT-DEL (don't type EXIT) to get your full AUTOEXEC.BAT and CONFIG.SYS to take effect.

Reply 4 of 4, by chinny22

User metadata
Rank l33t++
Rank
l33t++

Rather then uning the built in option you can create a shortcut to command.com on your desktop and modify that.
I've been doing that ever since I upgraded to Win95 and never run into the problems described.

Does mean you have to double click on the desktop icon rather then selecting dos mode from the shutdown menu.