Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

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. –  ultrasawblade Aug 7 '11 at 4:45

4 Answers 4

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

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.

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:

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

again, thanks.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.