Guide · Updated October 8, 2026 · 6 min read
CONFIG.SYS and AUTOEXEC.BAT: free up conventional memory
You have the game. You have the sound card. DOS says there are 540 KB free and the game wants 590. Here is the CONFIG.SYS and AUTOEXEC.BAT that fixes it, line by line, and a boot menu so your games, your tools and your plain DOS each get the setup they like.
How we pick. A product makes the list only when reviewers and long-time collectors keep recommending it, it does one job well and it will still work in five years. No filler, no mystery brands, and no paid placements. Not every item has been through our own bench, so we go by reputation. Prices change, so check the listing.
Some links on this page are affiliate links. If you buy through one, Conventional Memory earns a small commission at no cost to you. Affiliate links. As an Amazon Associate I earn from qualifying purchases. Disclosure
Careful. Before you change anything, copy the current files to CONFIG.OLD and AUTOEXEC.OLD, and keep a bootable floppy or CF card handy. A mistake in these files can stop a machine from booting.
What each file does
DOS reads CONFIG.SYS first, early in boot, to load device drivers and set limits. It then runs COMMAND.COM, which executes AUTOEXEC.BAT, a plain batch file that sets paths and variables and starts memory-resident programs. Both live in the root of the boot drive.
For memory, the plan has four moves. Load HIMEM.SYS to open extended memory and the HMA. Move DOS into the HMA with DOS=HIGH. Turn on upper memory blocks with EMM386.EXE. Then load everything that can fit into those blocks with DEVICEHIGH in CONFIG.SYS and LOADHIGH (LH) in AUTOEXEC.BAT.
A CONFIG.SYS that works
This version uses the multiple-configuration feature of MS-DOS 6 to offer a menu at boot. Edit the paths to match where your files really are. Lines starting with REM are ignored.
[MENU]
MENUITEM=GAMES, DOS games with sound and mouse
MENUITEM=EMS, Games that need expanded memory
MENUITEM=PLAIN, Plain DOS, nothing extra
MENUDEFAULT=GAMES,5
MENUCOLOR=7,1
[COMMON]
DEVICE=C:\DOS\HIMEM.SYS
FILES=40
BUFFERS=20
LASTDRIVE=Z
STACKS=9,256
[GAMES]
DEVICE=C:\DOS\EMM386.EXE NOEMS I=B000-B7FF
DOS=HIGH,UMB
DEVICEHIGH=C:\CDROM\CDROM.SYS /D:MSCD001
[EMS]
DEVICE=C:\DOS\EMM386.EXE RAM I=B000-B7FF
DOS=HIGH,UMB
[PLAIN]
DOS=HIGHA few notes on that file. I=B000-B7FF includes the unused monochrome text area as extra upper memory on a colour system, which often gives you one more block to load into. Do not use it on a machine with a monochrome card. FILES=40 and BUFFERS=20 are comfortable values for games, and every extra buffer costs a few hundred bytes. STACKS=9,256 is the DOS default, written out so you can see it.
An AUTOEXEC.BAT to match
The batch file reads the %CONFIG% variable that DOS sets from your menu choice and jumps to the matching section.
@ECHO OFF
PROMPT $P$G
PATH C:\DOS;C:\UTILS
SET TEMP=C:\TEMP
GOTO %CONFIG%
:GAMES
SET BLASTER=A220 I5 D1 H5 P330 T6
LH C:\CDROM\MSCDEX.EXE /D:MSCD001 /L:D
LH C:\MOUSE\MOUSE.COM
GOTO END
:EMS
SET BLASTER=A220 I5 D1 H5 P330 T6
LH C:\MOUSE\MOUSE.COM
GOTO END
:PLAIN
GOTO END
:ENDThe SET BLASTER line is read by DOS games to find your sound card. A is the I/O address, I the IRQ, D the 8-bit DMA channel, H the 16-bit DMA channel, P the MIDI port and T the card type. Match it to your card's real settings with the IRQ, DMA and I/O cheat sheet.
What the options in EMM386 mean
| Option | What it does |
|---|---|
| NOEMS | Provides upper memory blocks but no expanded memory. Saves memory and is the best default |
| RAM | Provides both upper memory blocks and expanded memory. Use it when a game demands EMS |
| NOEMS and RAM omitted | Only EMS, with no upper memory blocks (the default, and rarely what you want) |
| I=B000-B7FF | Includes that range as upper memory. On colour systems this is usually free |
| X=C800-CFFF | Excludes a range so EMM386 does not use it. Needed when a card has a ROM or buffer there |
| FRAME=E000 | Sets where the EMS page frame sits. Some games want a specific frame address |
| HIGHSCAN | Searches more aggressively for free upper memory, a little more risk of a clash |
| NOVCPI | Turns off a protected-mode sharing service some extenders use. Try it only when a DOS extender game complains |
Step by step: from 540 KB to 600 KB
- Take a baseline. Run
MEM /C /Pbefore you change anything and write down "Largest executable program size" and the free upper memory. - Back up the files. Copy CONFIG.SYS and AUTOEXEC.BAT to .OLD names. Keep a boot disk in case a typo breaks the boot.
- Load HIMEM first. HIMEM.SYS must be the first memory line. If it prints an A20 error, add
/MACHINE:with a value from the HIMEM documentation. - Add EMM386 and DOS=HIGH,UMB. Use NOEMS unless a game needs EMS. The DOS=HIGH,UMB line must come after the EMM386 line.
- Move drivers up. Change DEVICE= to DEVICEHIGH= for each driver, and put LH in front of TSR commands in AUTOEXEC.BAT. Reboot and run MEM /C again.
- Tune what did not fit. If a program will not fit in upper memory, it will show conventional memory use in MEM /C. Try loading it first, or use
LH /L:to pin it to a block, or let MemMaker try. - Test your games. Run a game from each menu choice. If one crashes, add an exclusion with X= to EMM386 for the range that card uses.
MemMaker, the automatic option
MS-DOS 6 ships with MemMaker. It reads your files, tries to load drivers into the best upper memory blocks, reboots a few times and rewrites CONFIG.SYS and AUTOEXEC.BAT with the right switches, such as DEVICEHIGH SIZE= values. Run MEMMAKER /UNDO if it leaves the machine in a worse state.
It is a good first pass, and it is the right tool if you are short of time. Hand-tuning wins by a few kilobytes, because you know which programs matter and in which order they should load.
Common errors and what they mean
| Message | Usually means |
|---|---|
| Unable to control A20 line | HIMEM.SYS cannot switch the gate. Try the /MACHINE: switch or check the BIOS for a fast-gate-A20 option |
| EMM386 not installed - unable to set page frame base | The page frame range clashes with a card ROM. Use FRAME= or exclude with X= |
| Error in CONFIG.SYS line 12 | A typo, a missing file or a path that does not exist. Count lines in your editor |
| Bad or missing Command Interpreter | COMMAND.COM is missing from the boot drive or the SHELL line is wrong |
| Bad command or file name | The PATH is wrong, or the file is not where the line says it is |
| Packed file is corrupt | A compressed program found its memory damaged or too small. Run it without LH, or from the PLAIN menu |
| Parameter value not in allowed range | A wrong number in a DOS=, FILES= or BUFFERS= line |
Tools for tuning a real DOS PC
Tuning CONFIG.SYS is safest with a boot floppy in the drive, and a spare disk for every experiment.
3.5 inch floppy disks, 1.44 MB
Blank media
Boot disks, drivers and test disks all need real floppies. Look for new-old-stock Maxell, Sony, Fuji or TDK, and test each disk after you format it.
Gotek with FlashFloppy
Floppy drive that reads a USB stick
Swaps a tired floppy drive for a USB stick of disk images. Ask the seller which chip is inside and look for the AT32F435 version.
Upgrading and Repairing PCs (Scott Mueller)
Book
The reference for the PC-compatible era, with the memory map, chipsets and buses explained clearly. Older editions suit vintage machines best and are cheap used.
Skip these
- Copying a CONFIG.SYS from a forum without reading it. Paths, drivers and card settings are specific to each machine.
- Loading every driver high without checking MEM /C. Some programs run worse or crash when loaded into upper memory.
- Putting DOS=HIGH,UMB before the EMM386 line.
Questions people ask
What does DEVICEHIGH do?
It loads a device driver into upper memory instead of conventional memory. It needs HIMEM.SYS, EMM386.EXE and DOS=UMB to have run first.
What does LOADHIGH or LH do?
It is the AUTOEXEC.BAT version of DEVICEHIGH. Put LH in front of a program name and DOS tries to load it into an upper memory block.
Should I use RAM or NOEMS?
Use NOEMS by default, since it leaves more memory for your programs. Use RAM only when a game explicitly needs expanded memory.
Can I use these files in DOSBox?
DOSBox emulates XMS, EMS and UMBs itself, so you do not need HIMEM or EMM386. You can toggle them in the DOSBox configuration file.
Why is my free memory lower after I add a sound card driver?
Sound card drivers and mixers are memory-resident programs. Load them high with LH, or skip the mixer if your games set their own volume.
Sources
From the timeline
- MS-DOS 6.22 1994
- MS-DOS 5.0 1991
- Intel 80386 1985
- Sound Blaster (original) 1989
Read next
- The DOS memory map, explainedWhy DOS stops at 640K, where the upper memory area, HMA, XMS and EMS live, the address map from 00000 to FFFFF, and how to read MEM /C on a real machine.
- IRQ, DMA and I/O address cheat sheet for ISA PCsStandard IRQ, DMA channel and I/O port assignments for 286, 386 and 486 PCs, common sound card, modem and network defaults, and how to untangle a hardware conflict.
- How to run DOS games on Windows, Mac and LinuxA step-by-step setup for DOSBox Staging: mounting a folder, running a game, fixing speed and sound, and where to buy legal copies of old games.
More to explore
- Retro PC starter kit: the gear worth buying
- How to fix a dead vintage computer
- How to play old PC games today
- Buying a vintage computer: what to check before you pay
- How to connect retro consoles to a modern TV
- BIOS beep codes for vintage PCs
- Floppy disk sizes and capacities explained
- How to replace a dead CMOS battery in a vintage PC
- Yellowed retro plastic: what works and what to skip
- How to store vintage computers and games
- Serial and parallel port pinouts and null modem cables
- IDE hard drive size limits explained
- Hayes modem AT commands cheat sheet
- CGA, EGA and VGA video modes and monitor pinouts
- Sound Blaster IRQ, DMA and the BLASTER variable
- MS-DOS version history, from 1.0 to 8.0
- Intel PC processors, from 8088 to Pentium 4
- Game console release dates in Japan, North America and Europe
- How to make a DOS boot floppy disk
- Best soldering station for vintage computer repair
- Best multimeter for retro electronics and vintage computer repair
- Replace a dying hard drive in a retro PC
- Gotek vs USB floppy drive vs Greaseweazle
- The retro bench kit
- How to buy a vintage computer on eBay without getting burned
- RetroTINK vs OSSC vs Framemeister: which retro scaler to buy
- Best capacitor kits and tools for recapping retro computers
- How to clean and test retro game cartridges
- Best sound card and MIDI setup for DOS games
- Game Boy IPS screen and battery upgrades: what to buy
- The holiday gift guide for retro fans
- The retro computing glossary
- The Bookshelf: books on computer and game history