Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

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

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

share|improve this question
"Completely bare" is the terminology you are looking for. That is what Windows "safe mode" is after all, with only necessary drivers and services running. – LawrenceC Aug 7 '11 at 4:45

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:

  menucolor   =14,1
  menudefault =normal,3

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

  include     =himem

  include     =himem
  include     =cd

  include     =himem
  include     =emm


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

  devicehigh  =\system\dos\emm386.exe NOEMS

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

  break       =on
  numlock     =on
  lastdrive   =z
  dos         =high,umb,auto
  fileshigh   =50
  buffershigh =20,0
  stackshigh  =9,256
  shell /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%

  call \system\config\ramdrive.bat
  goto misc

  call \system\config\setcdd.bat
  goto misc

  goto misc

  goto misc

  \system\dos\smartdrv b+ c+ d+ e+ f+ g+ h+ i+ j+ k+ l+ m+ n+ /q
  goto done
share|improve this answer

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

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.

share|improve this answer

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:.

share|improve this answer

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:


again, thanks.

share|improve this answer

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.)

share|improve this answer
Although your answers have been relevant, most or all of them are promotional in nature. This is likely to result in your account being suspended. If you'd like to promote your own products, please consider purchasing ads on Stack Exchange. See also the help center and – bwDraco Jan 6 '15 at 19:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .