Error Message containing the statement:
DOS ERROR 4
This error is directly related to the FILES= command in CONFIG.SYS. That command creates a static buffer that holds handles for all files currently open on your system.
The cause for this error is improper configuration. To fix the problem perform the following steps:
at the DOS prompt - type:
Look for a statement containing:
If it is not present, add the following line: (following F61 is: SEMI colon E Zero Zero)
(F71 or higher with Windows DO NOT include E00 with Win95+)
Place this statement in the AUTOEXEC.BAT file on a line where the statement is sure to execute. Make sure it is above a statement such as WIN, MENU, DOSSHELL etc. If your AUTOEXEC.BAT calls a program that takes control and never allows execution of the SET CLIPPER=F61;E00 your software will not execute correctly.
Save the AUTOEXEC.BAT file using the following steps:
Press and release the <ALT> key.
Press <X> for Exit
A prompt will appear
Loaded file is not saved. Save it now?
Select < Yes >
At the DOS prompt type:
Look for the statements
The FILES= must be at least 61. (FILES=61)
The BUFFERS= must be at least 41. (BUFFERS=41)
The buffers statement can be set to 10 if a caching program (such as SMARTDRV) is used. It is unnecessary in Win95/98
Edit the file to reflect this. Then save the file using the steps above.
Final Step. Reboot the PC by pressing <Ctrl><Alt><Del> simultaneously or press the RESET key on the PC.
At the DOS prompt type:
Look for CLIPPER=F61;E00. If you do not see this, the statement did not execute! Edit the AUTOEXEC.BAT file again and make sure the statement executes. You may need to increase your environment space by 128 bytes (/e:nnnn).
If you perform these steps and you still receive DOS ERROR 4, edit the AUTOEXEC.BAT file and change the SET CLIPPER= to F71;E00 (SET CLIPPER=F71;E00). Edit the CONFIG.SYS file and change the FILES= to 100 (FILES=100). Reboot the computer and try again.
NOTE 1: If the computer is set up to allocate EXPANDED MEMORY, program speed can be increased by removing the E00 statement in the SET CLIPPER line. E00 tells the system there is NO EXPANDED memory. If the EMM386 line includes the NO EMS switch, the ;E00 parameter MUST be added to the SET CLIPPER statement.
NOTE 2: MS-DOS Compatibility - Although MS-DOS has always allowed a FILES= command, this command was not used by DOS before version 3.2. Version 3.2 and lower use 20 files, no matter what the FILES= command is. This number is inadequate for CMS applications. You must use version 3.3 or higher of MS-DOS to be able to set the number of files on your computers.
NOTE 3: Most networks have file handles allocated at the server level, as well as at the workstation level. Be sure your server has enough handles available for all workstations to have 100 files open.
NOTE 4: In some versions of MS-DOS, it was reputed to be better to have an odd number of file handles. For this reason, handles of 31, 35, 49 and 99 are traditional. The maximum number of handles is 254. If you assign more than 254 you may be getting less.
FILES = 51 Minimum for CMS Applications
FILES = 254 Maximum allowed for DOS
NOTE 5: Handles are very small (14 bytes apiece or so) so adding lots of extras will not use much memory. Buffers on the other hand (BUFFERS=) are very large, and should be kept at 8 or 16. Buffers are allocated in blocks of 8. Please Note: If you are using a disk cache such as SMARTDRV, then reduce the BUFFERS statement to 10.
Return to CMS Support Page