R&R Technologies, Inc. - Technical Help
  Home
 
  Acronyms
 
  Default Fonts
 
  DOS 101
 
  DOS Commands
 
  DOS Freeing Memory
 
  General PC Help
 
  JavaScript Tips
 
  Linux Commands
 
  Network Security 101
 
  What is SSL?
 

How to free up memory for DOS
This is NOT for Windows95/98/ME!
by Ian Rochat (ianr@rnrtech.com)


If you are trying to run a DOS program sometime you will encounter an error something like "Not enough extended memory.", "Not enough free memory!", "You need 600k free conventional memory to run this program." or some such out of memory message. Then following are a few things to try and free up some extra memory on your system...

DOS 6.0 and above, try Memmaker.

If you have DOS 6.0 or higher, try running a program called memmaker. To do this, at the DOS prompt type "memmaker" and press Enter.

C:\>memmaker
 

This program does a decent job at moving things around and cleaning everything up to get a little extra memory for you. This program will have to reboot your system a few times to move things around.

Use QEMM if you have it.

If you have QEMM around, I would recommend installing that, it has been by far the best memory manager DOS. Like memmaker this program will reboot your system a few times to figure out the best way to load things. Anytime you change things in your autoexec.bat or config.sys QEMM will want to rerun to optimize your memory again. QEMM will give you some extra memory to run those programs that need lots of memory. (Those are generally games, but some applications are memory hogs as well.)

Doing things by hand.

We will need to use your favorite editor to edit CONFIG.SYS and AUTOEXEC.BAT. If you don't have a favorite, generally you can just use edit (it comes with MS-DOS versions 5 and higher).

First of all, let's make a backup copy of both your AUTOEXEC.BAT and CONFIG.SYS incase we goof something up, or we just want to go back to the old one. At the DOS prompt you will need to type "copy autoexec.bat autoexec.sav" after that completes, type "copy config.sys config.sav".

C:\>copy autoexec.bat autoexec.sav
        1 file(s) copied
C:\>copy config.sys config.sav
        1 file(s) copied
 

Let's start by editing your CONFIG.SYS, at the DOS prompt type "edit config.sys" and press Enter.

C:\>edit config.sys
 

The following is the most optimal CONFIG.SYS, replace C:\DOS with the path to your DOS files.

For DOS 6 and above:

CONFIG.SYS
DEVICE=C:\DOS\HIMEM.SYS
DEVICEHIGH=C:\DOS\EMM386.EXE RAM
DOS=HIGH,UMB
 

For DOS 5:

CONFIG.SYS
DEVICE=C:\DOS\HIMEM.SYS
DEVICEHIGH=C:\DOS\EMM386.EXE RAM
DOS=HIGH
 

If you need a CD-ROM drive for the game or application you want to run, then add your CD-ROM driver, it is usually something like the following (although, the driver name and location will vary from computer to computer), also make sure LASTDRIVE is equal to the letter of your CD-ROM drive (usually D unless you have more than one partition or hard drive).

CONFIG.SYS
DEVICEHIGH=C:\MTM\ATAPICD.SYS /D:CDROM01
LASTDRIVE=D
 

If you need a sound card for the game or application you want to run, then add your sound card driver(s), this varies depending on your sound card and driver locations. Just be sure to change DEVICE= to DEVICEHIGH= if it isn't already.

Now let's edit your AUTOEXEC.BAT, at the DOS prompt type "edit autoexec.bat" and press Enter.

C:\>edit autoexec.bat
 

The following is the most optimal AUTOEXEC.BAT, replace C:\DOS with the path to your DOS files.

The PATH statement should remain how it is in your current autoexec.bat, below is the very minimal PATH statement.

The PROMPT statement is the standard prompt. In MS-DOS 6 and above you no longer need a PROMPT statement, so you don't have to copy that line. If you have a custom PROMPT line, you can leave it how it is.

AUTOEXEC.BAT
@ECHO OFF
SET PATH=C:\DOS
PROMPT $P$G
 

If you need a mouse for the game or application you would like to run, then add the following line (or a different mouse driver if you use a different one, but be sure LOADHIGH is in front of it):

AUTOEXEC.BAT
LOADHIGH C:\DOS\MOUSE.COM
 

If you don't have a MOUSE.COM in your DOS directory and need to use a mouse, then see if you have a MOUSE.SYS in your DOS directory. If you have a MOUSE.SYS instead of MOUSE.COM you will need to add the following line to the bottom of your CONFIG.SYS file:

CONFIG.SYS
DEVICEHIGH=C:\DOS\MOUSE.SYS
 

If you need a CD-ROM drive for the game or application you want to run, then you will need a line like this so your system will recognize the line you added in your CONFIG.SYS:

AUTOEXEC.BAT
LOADHIGH C:\DOS\MSCDEX.EXE /D:CDROM01
 

If you have a sound card, you may need to keep some SET SOUND= or SET SB= or some such lines in your AUTOEXEC.BAT. Those take up VERY LITTLE memory anyway, so don't worry about those.

You're done, reboot your system and hopefully you have enough memory available to run the program that you want to.

If you have extra memory, you should try loading SMARTDRV in your AUTOEXEC.BAT. SMARTDRV can speed up your computer by a considerable amount.

AUTOEXEC.BAT
LOADHIGH C:\DOS\SMARTDRV.EXE
 

But if you still don't have enough memory, remove anything that you don't ABSOLUTELY NEED. You can put REM followed by a space in front of lines to comment them out if you'd like instead of deleting them.

Say you would like to try running without a mouse driver loaded, although you're not sure how this will work. So you don't want to delete the line incase you need to re-add it easily later, instead you just comment it out:

AUTOEXEC.BAT
REM LOADHIGH=C:\DOS\MOUSE.COM
 

Now reboot your system again and try to run the program that you want to, as long as it doesn't work, keep commenting out other lines and rebooting, until you get it to work.

You can use a utility called MEM to display memory information on your computer. It will tell you how much memory is free and how much is used. Just type "mem" at the DOS prompt.

C:\>mem
 

If you would like more details on what is using up your memory, at the DOS prompt you could type "mem /c /p".

C:\>mem /c /p
 

If you can't seem to get things to run how you want them. Remember we made a backup of both of your startup files (AUTOEXEC.BAT and CONFIG.SYS). So now we can copy those backups back over the files that didn't seem to work out.

C:\>copy autoexec.sav autoexec.bat
        1 file(s) copied
C:\>copy config.sav config.bat
        1 file(s) copied
 

 
  
This site is hosted by MugWeb.com ©2006 R&R Technologies, Inc.