6

Is there a way to start MS-DOS 6.22 in safe mode through a command in the config.sys file?

I'm using the multi-configuration option in config.sys and need an option to start the machine in safe mode OR completely bare: no himem.sys, no ifshlp.sys, nothing.

Is this possible?

Currently my config.sys looks like this:

[Menu]
MenuItem=MS-DOS, MS-DOS 7.00
MenuItem=4DOS, 4DOS 6.01
MenuItem=MEMTEST, MemTest86+ 4.20 (Press Shift+F5 and run MT420.EXE)*
MenuDefault=4DOS,5

I need the third option to start in safe mode without user intervention.

Gareth
  • 19,080
eli
  • 63

5 Answers5

3

As Michael said, there is no “safe-mode” for DOS.

What you need to do is to re-factor the config.sys file, so that you separate out each of the components to be loaded into its own section, then you can include them in each configuration as needed, and use the [common] section for, well, items common to all configurations. Here is a sample config.sys with modularized configurations:

[menu]
  menucolor   =14,1
  menudefault =normal,3

  menuitem    =c_ramdisk, Ramdrive
  menuitem    =c_cddrive, CD
  menuitem    =c_emm,     EMM
  menuitem    =c_bare,    Bare


[c_ramdisk]
  include     =himem

[c_cddrive]
  include     =himem
  include     =cd

[c_emm]
  include     =himem
  include     =emm

[c_bare]


[himem]
  devicehigh  =\system\dos\himem.sys /testmem:off

[emm]
  devicehigh  =\system\dos\emm386.exe NOEMS

[cd]
  devicehigh  =\system\dos\vide-cdd.sys /D:blah
  installhigh =\system\dos\mscdex.exe  /D:blah


[common]
  break       =on
  numlock     =on
  lastdrive   =z
  dos         =high,umb,auto
  fileshigh   =50
  buffershigh =20,0
  stackshigh  =9,256
  shell       =command.com /e:640 /p

Then in autoexec.bat, the environment variable config will be set to correspond to the configuration that was selected at boot, so you can do something like this:

@echo off
break on
goto %config%

::c_ramdisk
  call \system\config\ramdrive.bat
  goto misc

::c_cddrive
  call \system\config\setcdd.bat
  goto misc

::c_emm
  goto misc

::c_bare
  goto misc

:misc
  \system\dos\smartdrv b+ c+ d+ e+ f+ g+ h+ i+ j+ k+ l+ m+ n+ /q
  goto done
Synetech
  • 69,547
2

Well, there are ways to bypass the CONFIG.SYS and AUTOEXEC.BAT files on startup, which would be close to something like a "safe mode" for DOS.

Pressing F5 after restarting, when the "Starting MS-DOS..." text appears will bypass both CONFIG.SYS and AUTOEXEC.BAT.

F8 will cause MS-DOS to ask if each line in CONFIG.SYS should be executed. I don't think it does anything with AUTOEXEC.BAT.

Be aware that if you totally skip CONFIG.SYS and AUTOEXEC.BAT you will not have a working CD-ROM, sound, or much else besides A: and C:.

LawrenceC
  • 75,182
1

First of all, in DOS there is no such thing as "safe mode". Secondly, if you don't want to load a bunch of things in the config.sys file then get rid of them.

I remember that I often had multiple versions of config.sys named things like config.old, config.tst. Copy whichever one you need to config.sys and then reboot. The same thing goes for autoexec.bat. Keep several versions with different names and COPY the one you want to the name that is actually used and loaded.

Then safe mode is just

C:
CD \
del autoexec.bat
del config.sys

And reboot the system. Make that into a .BAT file if you wish, but DO NOT DO THIS UNTIL YOU BACKUP YOUR CURRENT FILES.

0

thanks guys, but apparently the problem was my msdos.sys file.

my config.sys file was already as Synetech suggested, but still himem.sys and ifshlp.sys were being loaded in the Bare section.

so i went to msdos.sys. after removing the following 3 lines, it suddenly worked and the above 2 files (himem and ifshlp) did not load any more.

the 3 lines were:

[Paths]
WinDir=C:\DOS
WinBootDir=C:\DOS
HostWinBootDrv=C

again, thanks.

eli
  • 63
0

If you're editing the MSDOS.SYS file as a simple standard text file, then you're not using MS-DOS 6.22. That's MS-DOS 7.0 or newer, from Win95 or newer.

Why not use CONFIG.SYS to include DOS=NOAUTO?

That's the intended way to avoid the newer auto-loading HIMEM and IFSHLP.

I believe that can be combined with other DOS commands in the CONFIG.SYS, like DOS=HIGH,UMB,NOAUTO.

For more details about MSDOS.SYS in the newer MS-DOS code, see: ][CyberPillar][: MSDOS.SYS info. For instance, renaming MSDOS.SYS to WINBOOT.INI will probably work. (Although, if there is a problem and the system won't boot off the hard drive anymore, that will probably be inconvenient to fix, so be prepared to fix the problem if there's an issue.)

TOOGAM
  • 16,486