Starting MS-DOS in safe mode via config.sys menu?

5

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.

eli

Posted 2011-02-06T11:52:57.547

Reputation: 51

"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 – 2011-08-07T04:45:27.847

Answers

2

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

Posted 2011-02-06T11:52:57.547

Reputation: 63 242

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.

Michael Dillon

Posted 2011-02-06T11:52:57.547

Reputation: 899

1

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

Posted 2011-02-06T11:52:57.547

Reputation: 63 487

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

Posted 2011-02-06T11:52:57.547

Reputation: 51

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

Posted 2011-02-06T11:52:57.547

Reputation: 12 651

3

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/behavior] and http://meta.superuser.com/questions/2352.

– bwDraco – 2015-01-06T19:23:49.467