4DOS V3.nn Version History
This page can be
downloaded in MS-Word .doc format.
4DOS Change Log - this log describes changes and bug fixes to version
3.nn of 4DOS
Installation and Configuration
- The 4DOS loader (4DOS.COM) has been completely
rewritten. It now takes a little under 3K of low memory (less than
COMMAND.COM!). In version 2.21 it required close to 5K.
- 4DOS now supports swapping to XMS extended
memory. In order for it to work you must have an XMS driver such as
HIMEM.SYS loaded, or an equivalent program such as 386MAX or QEMM 5.0.
- The resident portion of 4DOS and the master
environment can now be loaded high if your hardware and software support
XMS Upper Memory Blocks (UMBs). If both options are used 4DOS's low-memory
footprint can be reduced to as little as 256 bytes. See the options
section below for details.
- The 4DOS loader now distinguishes processor
types more carefully when loading the EXE file. 4DOS286.EXE (which in fact
runs on any 80186 / 188 or later processor) will now automatically be
loaded for all processors other than 8086 / 88. This should make NEC V20 /
V30 systems run 4DOS286 automatically.
- The loader now displays the size of the swap
area being used in K, e.g. "EMS swapping initialized (80K)".
- IF 4DOS is swapping to EMS and your EMS driver
supports the LIM EMS 4.0 specification, EMS swapping blocks will be named
4DOS:nnn where nnn is the shell nesting level (000 for the primary shell). Previously the blocks were unnamed. They will remain unnamed on EMS 3.2
- Errors detected by the low memory portion of
4DOS are now quite cryptic, to save space in low memory. They all read
simply "4DOS error XX". See the Error Messages appendix in the manual for
the meaning of the codes.
Aliases and Environment:
- Aliases are now in a separate block, whose size
is defined with the new SHELL and 4DSHELL parameter /A:nnnn. You will need
to add this parameter, and probably reduce your environment size
- Since aliases are in a separate block, there is
little need to swap out the master copy of the environment to save space.
Therefore 4DOS defaults to a memory-resident master environment (formerly
selected with the /M command line option), whether you specify the
environment size with /E or /M.
Command Line Options:
Technical Information on Installation:
- 4DOS.COM has been modified to set the PSP memory
size, rather than relying on DOS to do it properly. This allows 4DOS's
swapping mode to work properly in the OS/2 compatibility box.
- The critical error and ctrl-C / ctrl-break
handlers are now in low memory all the time. Previously they were in high
memory, and switched to low memory when an application was run. This
should solve some compatibility problems with programs that wanted these
handlers to be in low memory and/or to have their addresses fixed, rather
than changing each time an application was run.
- 4DOS now hooks interrupt 2E (in the primary
shell only). Some programs use this to find the root command processor
and/or global master environment. Note 4DOS does NOT process INT 2E in any
way, it just returns. But it does hook it.
Features and Usage
- "4DOS286" is now compiled in 186-compatible mode
to assure compatibility with NEC V20/V30 microprocessors. This does not
affect the speed or size of the EXE file.
- The functions that accept multiple arguments
(COPY, MOVE, DEL, RENAME, etc.) no longer abort on an error - they will
continue processing the remainder of the arguments, and then return an
error. This will allow things like DEL *.BAK to continue when a read-only
file exists among the .BAK files and cannot be deleted.
- SHARE / LAN support has been added for all file
I/O. (For example, LIST and TYPE open their files in "deny write" mode;
other systems can still read the files, but can't write them while LIST
and TYPE are using them). This change should be transparent to most users
but will improve compatibility on some networks.
- The ctrl-C / ctrl-Break handler has been cleaned
up and should be more reliable.
- 4DOS now supports the DOS 4.0 DOSSHELL command
without the use of special batch files, COMMAND.COM, etc.
- A bug in the 4DOS beep subroutine could cause
the beep issued for an invalid keystroke or any other reason to stay on
indefinitely when running a multitasker with background processing active
(e.g. DESQView, VM/386), or when using PC Magazine's ANSI.COM version 1.2.
This has been fixed.
- 4DOS now issues a specific interrupt just after
displaying the prompt and before accepting input. This allows TSRs to tell
when 4DOS is back at the prompt. The interrupt call is an INT 2F with AX =
0D44Eh. Any routine intercepting this should preserve at least the SI, DI,
BP, SP, DS, ES, and SS registers.
- The program name passed to DOS for external
programs is now set to upper case. Previously some external programs could
not find their own name as they were not written to handle lower case.
This resulted in errors in finding overlay files and other similar
- If the screen width in the BIOS is 0, 4DOS now
defaults to 80, to accommodate the TI Professional.
- The date, time, and thousands separator
characters are now set by the default country definition (in DOS 3+).
Previously the country definition only affected the date and time format.
- Previously 4DOS sometimes failed to ask ask
"Cancel batch file" when aborting via ^C from an external program. This
has been fixed.
Command Line Editing:
- The ^D (delete) command now displays the
previous history command after deleting the current one.
- A new command, ^E (end), moves to the last entry
in the history list and displays it.
- Filename completion (F9 / F10 keys) has two
- The F8 key will now return the previous
matching filename if you go past the filename you want in the list.
- When scanning the directory for filename
completion 4DOS now starts with the name you type (if any) and appends a
"*.*" if no extension is given (as it used to), and also a "*" if an
extension is given (that's the new part). This makes names like "FILE.E"
expand as "FILE.E*".
- The command line parser has been completely
rewritten. (The parser is the part of 4DOS that reads your commands
and analyzes them for aliases, environment variables, program names,
switches, etc.). It now supports multiple commands and redirection more
gracefully. Specific changes are listed below:
- When entering multiple commands on the line,
each command is parsed just before it is executed. (This is true at the
prompt, in aliases, and in batch files.) Previously all commands on the
line were parsed before any of them were executed.
- As a result, environment variable and alias
changes made in one command now take effect immediately, and will affect
the parsing of commands later on the same line. Previously these changes
did not take effect until the entire line had been parsed.
- The 255-character command limit now applies to
each individual command as it is expanded, and to the original command
line. Previously the entire command line after alias and variable
expansion had to fit within 255 characters as well.
- EXCEPT, FOR, GLOBAL, IF, and SELECT now accept
aliases as the command argument.
- Filename parsing has been modified to allow a
forward slash ("/") as a path separator in most places. However commands
which use "/" for switches may still get confused if you use this
- "Whitespace" (delimiter) characters (;=,)
following the command name are no longer skipped for the first command
line argument, but still are for the second argument onwards. This allows
commands like "XYZ,,,,," to pass white space characters (comma is a
whitespace character in DOS) correctly to an external program.
- The parser's memory handling has been rewritten
to eliminate "stack overflow" errors with long aliases.
- You can now disable the saving of a specific
command to the history list by prefacing the command with "@".
- Filenames ending with a "\" are now assumed to
be directory names, i.e., "C:\4DOS\" is equivalent to "C:\4DOS\*.*". This
allows you to force 4DOS to consider something to be a directory name
rather than a file name if there may be ambiguity.
- Alias expansion will now take place even when
the first item on
the line is an environment variable. Previously executing "%var"
as a command would not work when the variable contained an alias
- ECHOing of the command line now occurs before
piping. This allows commands like "echo y | del *.*" to work when ECHO is
on. Previously these commands would pipe the ECHO command itself,
instead of the Y, to the following command, and the command would not
- The parser has been modified to not treat
parentheses as special characters; FOR, EXCEPT, and SELECT have been
modified to do their parentheses parsing internally. This fixes a problem
with renaming files whose names start with a left parenthesis.
- Alias expansion has been changed slightly.
Previously, if you had variables in an alias (%1, %2, ...) then once
variable substitution was complete 4DOS would discard the remainder of the
command line. Now, 4DOS discards the command line up to and including the
highest referenced variable, and appends the rest of the line to the end
of the expanded command.
- A new extension to support "in memory batch
files" has been added (.BTM = "batch to memory"). The features of .BTM
- The file will be loaded into memory and then
executed without requiring further disk I/O. This will be 2 - 5x faster
than the approach used for .BAT files (to retain compatibility with
COMMAND.COM), where the file is closed and reopened for each line.
- You can now remove the disk containing an
original .BTM file without having to worry about the "Missing batch
- .BTM files are limited to 64K bytes in size.
- Do not load TSRs (memory-resident programs)
from a .BTM file. If you do the memory released when the .BTM file is
done will leave a "hole" in memory below the TSR. This is not harmful,
but it wastes memory.
- Self-modifying batch files can NOT be
converted to .BTM files.
- 4START can now be a .BAT or .BTM file.
- Batch file variable %0 now returns the batch
file name as it was entered on the command line, in upper case, just like
COMMAND.COM. This should fix compatibility problems with some installation
- The %# variable has been added to batch files.
It returns the number of command line arguments (%1 - %n).
- Redirection is now fully nestable. For example,
invoking a batch file XYZ with "XYZ > OUT.DAT" will redirect all output
from the batch file to OUT.DAT unless additional redirection is
encountered within the batch file.
- The EXCEPT, FOR, GLOBAL, and SELECT commands now
handle I/O redirection when processing begins for the second command
(previously it was handled when the EXCEPT, FOR, GLOBAL, or SELECT was
processed). In FOR, this allows you to redirect output to a file whose
name depends on the FOR variable.
- Redirection of STDERR only has been added. The
syntax is ">&> filename" to redirect STDERR to a file, or ">>&> filename"
to append STDERR to a file.
- 4DOS now checks for duplicate redirection (i.e.,
"DIR > 1.DAT > 2.DAT"). Previously duplicate redirection would end up with
output permanently redirected to never-never land once the command was
- VERY IMPORTANT: The 4DOS internal variables (CWD,
CWDS, DOSVER, etc.) are now prefixed with an underscore (_). This should
reduce conflicts with your own environment variables of the same name. You
must modify any batch files or aliases which use these variables or they
will not work properly with 4DOS 3.0. The only variables 4DOS uses which
are NOT prefixed with an underscore are the ones which are actually
inserted in the environment: PATH, COMSPEC, 4DSHELL, TMP, etc.
- Many new internal variables have been added; see
the manual and README.DOC for an up-to-date list of all variables.
%? Exit code of last external program
%_bg, %_fg Current screen colors
%_cpu CPU type
%_cwp, %_cwps Like %_cwd and %_cwds but without the drive
%_shell Current shell nesting level
- Variables you insert into the environment with
SET or in any other way now override 4DOS internal variables of the same
name (%_CWD, %_DATE, etc.).
- A new internal "function variable" type has been
added. These functions allow you to parse strings. See the manual for full
details. The functions are:
%@ext[filename] Get extension part of filename
%@full[filename] Get full file name
%@len[string] Get the length of a string
%@line[filename,n] Get line n from a file (see README.DOC, not described
%@name[filename] Get name part of filename
%@path[filename] Get path part of filename
%@search[filename] Search the path
%@substr[string,start,len] Extract a substring
- The '$' character has been added to the valid
- The new syntax %[varname] will accept any
sequence of characters as a valid environment variable name for expansion.
This will override both the assumption that a variable is a batch or alias
argument if it starts with a digit, and the restrictions on what
characters are normally considered part of a variable name.
Version 3.01, 5/22/90
- Disk swapping should no longer cause occasional
system hangs if the Ctrl-C or Ctrl-Break key is hit while 4DOS is swapping
itself in from disk (i.e. when exiting an application).
- CLS, LIST, and SELECT are no longer affected by
a video BIOS bug in old IBM PCs.
Command Line Options:
- Either / or - may be used as the switch
character on the 4DOS command line (eg SHELL=4DOS -S:E instead of /S:E,
- Option files (@filename):
The new @filename option allows you to put 4DOS options into a disk file
instead of specifying them on the SHELL= line in CONFIG.SYS. This gets
around a bug in DOS which limits the length of the SHELL= line.
The file specified in the "@filename" option can have more than one line,
and is limited to a total of 255 characters in the file, not 128. A file
invoked with @filename can have another @filename inside it. Wherever
@filename occurs, all options placed after it are ignored, so it must be
the last item present.
- Alias size (/A):
Aliases are now in a separate block, whose size in bytes is defined with
the new SHELL and 4DSHELL parameter /A:nnnn. You will need to add this
parameter, and probably reduce your environment size accordingly.
The /A switch supports the same incremental syntax used with /E, i.e. /A+n.
When used in 4DSHELL this allows you to guarantee a specified amount of
free alias space in
- Environment size (/E):
4DOS now defaults to a memory-resident master environment (formerly
selected with the /M command line option). The /M switch is therefore
obsolete, but will still be accepted. It is equivalent to /E.
/E:nnnn may also be followed by S (/E:nnnnS) to swap the master copy of
the environment; this is equivalent to the 4DOS version 2 /E option. This
will save a small amount of low memory, but may not be compatible with all
applications, and will not work with any application that needs to modify
the master environment.
/E:nnnn may be followed by U (/E:nnnnU) to load the master environment
into a UMB in high DOS memory. This switch is subject to the same
compatibility restrictions as /U (below).
- Reduced swap size:
4DOS will normally reduce the space used to swap a secondary shell by
retrieving static information from the primary shell's swap area. This
reduces secondary shell swap size from 68K or more to about 20K. This
feature will not work if the total of your alias, history, and environment
sizes in the secondary shell is larger than that specified for the primary
shell, or if the size of DOS memory has been reduced when the secondary
shell is started (e.g. by a program like DESQView that reserves some
memory at the top end of DOS memory). In such cases secondary shells will
a full-size swap area. The size of the swap area is dis played in the
"swapping initialized (nnK)" message when 4DOS starts.
- Disk swapping (/S:D):
The default location for disk swap files in secondary --> shells is now in
the root directory of the drive specified in the COMSPEC environment
variable (the drive where 4DOS.COM is stored). If you want disk swap files
to go to another drive or directory, use the "/S:Bd:\path" or "/S:Dd:\path"
settings in the 4DSHELL environment variable (see page 25 of the manual).
This should cut down on swap file clutter, yet leave you with complete
control over swap file location.
- Load high (/U):
The new /U switch requests that 4DOS load its resident portion into an
Upper Memory Block (UMB) at the high end of DOS memory, reducing low
memory usage to 256 bytes.
The /U switch requires 386MAX, QRAM, or QEMM 5.0 or above. It may not be
compatible with all other software products. See COMPAT.DOC for full
details on compatibility.
Features and Usage
- 4DOS now has better support for non-English
characters in filenames, environment variables, and aliases.
- Most of the changes in version 3.0 to allow
shareable file access on networks have been removed, because some networks
and a few popular programs (e.g. SHARE and FASTOPEN) couldn't handle them
properly. SHARE/LAN support is now provided where possible, but is avoided
in many places where it has been found to cause trouble. This change
should eliminate most or all I/O redirection problems on networks.
- A number of changes have been made to increase
4DOS's execution speed, and reduce its size slightly. Speed improvements
are primarily in the areas of file access (particularly .BAT files)and
environment variable and alias expansion. They may not be noticeable on
- 4DOS can now correctly handle text files (.BAT
or .BTM files, files to be LISTed or TYPEd, etc.) which have CR/LF, CR
only, or LF only at the end of each line. Previously not all of these line
terminators worked correctly.
Command Line Editing:
- You can now enter characters that would normally
be interpreted by the line editor as a command (e.g., Ctrl-D or Ctrl-K).
To do so precede the character with an ASCII 255 (hold down the ALT key
and enter 255 on the numeric keypad, then release the
ALT key). To enter the ASCII 255 itself into the line, you must enter it
- The cursor shape will now be changed properly
when you hit the Ins key to switch editing modes. Previously if SETDOS
specified a block cursor in the default mode it would not be changed to an
underline when Ins was hit.
- Fixed a bug in alias expansion which occurred
when a "%" was the
last character on the line.
- See the commands section below for information
on the new LOADBTM command, which allows any batch file to work as a BTM
file some or all of the time.
- Batch files can now be nested 6 levels deep (the
previous limit was 4).
- 4DOS now checks for duplicate redirection (i.e.,
"DIR > 1.DAT > 2.DAT"). Previously duplicate redirection could hang the
- The system will no longer hang if a command
specifies input redirection after output redirection.
parentheses, which may be nested
unary + or - operators
multiplication and division operators: *, /, and %% (modulo)
addition and subtraction operators: + and -
environment variables, variable functions, and constants
The elements of an expression are processed with the precedence shown above.
For example, 5*3+2 is treated as (5*3)+2 rather than 5*(3+2). Examples of
the use of %@eval are:
Increment a variable: set a=%@eval[%a+1]
Perform environment variable arithmetic:
set c=%@eval[(%a*2) + (%@len[%b]-5)*7]
Evaluate expressions in IF:
if %@eval[%@substr[%_time,0,2] %% 12] == 0 echo 12:00!
Set up a simple command line calculator:
alias calc `echo The answer is: %@eval[%&]`
- Another new function, %@INDEX[string1,string2] returns
the position of string2 within string1 (string2 can be as small as a single
character). The first position in string1 is numbered 0. If there is no match, the function returns -1.
- When expanding environment variables 4DOS will display a
"Variable loop" error if you nest variable functions too deep, or
define variables which refer back to themselves.
- 4DOS.COM now closes file handles 5 - 29 when it starts. This
should solve problems with programs that pass open file handles
to a secondary shell.
- 4DOS now generates two different INT 2F calls to allow TSRs to
tell when 4DOS is back at the prompt. These calls have AX =
D44Eh. The first occurs immediately before displaying the
prompt, with BX = 0; the second occurs after displaying the
prompt and immediately before accepting keyboard input, with BX =
1. Any routine intercepting these calls should preserve at least
the SI, DI, BP, SP, DS, ES, and SS registers.
- ALIAS: ALIAS /R can now read multiple files, for example:
alias /r alias1 alias2 alias3
- CD and CDD: Modified to allow forward slashes (/) in
- COPY: There are several changes:
Problems with appending files in binary mode have been fixed.
The way that COPY accesses files has been modified to minimize or eliminate problems with the MS-DOS APPEND command.
The /R and /U switches are now ignored if the target is a
A ^Z (end of file mark) is now properly added to the target
file when it is in ASCII mode.
- DEL: Speed has been improved somewhat, especially on
- DESCRIBE: 4DOS description files will no longer get mixed up
between directories when running reasonably-behaved data pathing
utilities like DPATH.
- DIR: Changed to display directory totals even when the "File not
found" message is displayed. Changed the /F and /H switches so
they don't conflict with each other.
- DRAWBOX: Styles 3 and 4 now work properly.
- FOR: Now aborts when a nested batch file CANCELs. Also, fixed a
bug that was causing FOR variables to be ignored inside double
- GLOBAL: Added a /Q(uiet) switch to disable the display
of "GLOBAL: pathname".
- GOTO inside an IFF statement now cancels all IFF parsing,and assumes you've branched completely outside the IFF construct.
If you haven't, you will get "Unknown command" errors on subsequent ELSE, ELSEIFF, and ENDIFF statements (see examples below).
Also fixed a bug which prevented GOTO from branching to the end
of the file from within a GOSUB subroutine.
copy file1 a:
goto done <--- Legal - branches outside the
else IFF block
copy file2 b:
goto test <--- Illegal - branches within IFF
[do some other work here]
- HELP: There are several changes to HELP:
There are many corrections and additions to the text, including a complete ASCII table.
A new "soft pagination" capability enables many commands to
be displayed completely on one screen if using more than 25
lines, but paginates in a logical spot if using a 25-line
HELP is now DESQView-aware and should run properly in a
less than full screen DESQView window.
HELP now accepts up to 16 pages per topic and 32 crossreferences per topic, to allow 4MAKE users to install longer
topics inside the help file.
Three new environment variables have been added to give you
better control over HELP:
4HELP Specifies the full path and file name for the
help program to be loaded when F1 is pressed.
If not used, 4DOS will look for HELP.EXE in
the current directory and then on the PATH.
4HELP affects only F1, NOT the HELP command;
if you need to change how the HELP command
works as well, use an alias (see example
4HELPF Specifies the full path and file name for the
help text file. If not used, HELP will
search for DOS.HLP in the directory specified
in 4HELP (if any), then in the current directory and on the path.
4HELPC Specifies control switches for HELP.EXE. At
present the only switch is /R, which disables
dynamic window resizing and forces all text
screens to be displayed at the full screen
For example, the following commands load HELP.EXE (which has
been renamed to 4DHELP.EXE) from directory D:\4DOS when F1 is
pressed, set up an alias to load this same program when the
HELP command is used, load the help text file from RAMdisk
drive I:\, and disable dynamic window resizing:
alias help d:\4dos\4dhelp.exe
rem The above could also use "alias help %[4help]"
- IF: There are several corrections to the description
in the manual. Some of these errors are present only in early
copies of the manual:
The DOS memory size option is named DOSMEM, not DOSFREE.
The tests which check a numeric value (EMS, DOSMEM, etc.)
use the same relational operators as the string tests, as
shown in the examples. For example, the syntax for EMS
EMS relop n[K|M]
where "relop" means EQ, GE, GT, etc. The "relop" is optional
for ERRORLEVEL, but required for all other numeric tests.
The MONITOR and VIDEO tests also require a relational operator (==, EQ, or NE) as described above for numeric tests.
The IF ATTRIB test has an additional option: "N" tests for
no attributes set (i.e. all of the other attributes are off).
IF ATTRIB volname V will only work if the volume name refers to the root directory, and if there is a period after
the eighth character in volume names of nine characters or
more (e.g. to test for volume "MYFILES0107" in drive A:, use
IF ATTRIB A:\MYFILES0.107 V ...).
* Two tests are missing from some copies of the manual:
IF DISKFREE relop n
Tests the disk free space on the current drive.
Cannot be used to test other drives.
IF FILESIZE filename relop n
Tests the size of the specified file.
if diskfree gt 40M echo Plenty of room
if filesize myfile.dat gt 360K echo It won't fit!
- IF: String comparisons will now be done numerically
if both values being compared begin with a digit. This allows
you to do true arithmetic tests. For example:
if %aa gt %bb ... This test will succeed because it
will compare the numeric values 27
if "%aa" gt "%bb" ... This test will fail because it will
compare the alphanumeric values
"027" and "20", and the "02" will
appear 'smaller' (alphanumerically)
- IF: The ATTRIB test for a volume label has been changed to get
around a bug in DOS, and should now recognize labels correctly.
- IFF: ELSE and ENDIFF will now be recognized properly even if
they are not followed with whitespace.
- INPUT: Fixed a bug with very long variable names and/or input
- KEYSTACK: There are two changes:
KEYSTACK now supports a new symbol, !, to clear keystrokes
from the typeahead buffer, as well as anything in the
KEYSTACK buffer. For example:
keystack ! @59
will clear the typeahead buffer before stacking the @59 (F1)
Some programs will not interpret stacked keystrokes properly unless they contain both the correct ASCII value and the
correct keyboard "scan code". For example, if you attempt to
KEYSTACK an "Enter" using ASCII code 13 (carriage return) and
see a small musical note instead, the program you are running probably needs
the scan code to interpret the keystroke properly.
KEYSTACK now supports the entry of scan codes for standard
ASCII keys. To enter the scan code, multiply it by 256 and
add it to the ASCII code. Using the same example, the scan
code for the Enter key is 28, so the full value for this key
would be 28*256+13 = 7181. With some programs you will find
that KEYSTACK 7181 works when KEYSTACK 13 does not (or vice
versa). Experimentation is required to get the correct value. A full discussion and table of scan codes is beyond the
scope of this document, but is available in many basic PC
- LIST: There are several changes:
Changed the search and print keys to use letters instead of
function keys: F(ind), N(ext), and P(rint). This avoids
conflicts when you wish to redefine the function keys for
Added a new switch, /H, to strip the high bit of each character, for displaying WordStar documents and other similar
- LOADBTM: This is a new command. It will switch the
current batch file to and from .BTM mode. The syntax is:
LOADBTM [ON | OFF]
LOADBTM ON loads the entire file into memory and processes the
following lines as a .BTM file. LOADBTM OFF unloads the file
from memory and processes the following lines one by one like a
.BAT file. Both commands can be used regardless of the file's
LOADBTM will allow you to have a single batch file for both
COMMAND.COM and 4DOS, and select .BTM mode via a statement like:
if "%@eval[2+2]" == "4" loadbtm on
Since the %@eval function does not exist under COMMAND.COM, the
IF test will fail there and the rest of the line will be ignored.
Under 4DOS where %@eval exists, the LOADBTM ON will be executed.
LOADBTM will also allow you to load TSRs from a .BTM file by
switching it into .BAT mode, loading the TSRs, and switching back
to .BTM mode. However note that, depending on what the file
does, such mode switching can erase much of the speed gained by
using a .BTM file in the first place.
- LOG: Fixed a problem which caused a ^C to occasionally hang the
system when LOG was ON. Also changed LOG to automatically switch
LOG OFF if it couldn't open the log file.
- MOVE: Now returns an "Access denied" error
if you try to move files to a character device. Also the way that MOVE accesses
files has been modified to minimize or eliminate problems with
the MS-DOS APPEND command.
- REM: Will now be echoed if ECHO is ON.
- SET: SET /R can now read multiple files, for example:
set /r env1 env2 env3
- SETDOS: There are two changes:
/S now resets the cursor shape immediately, so it can be used
to hide the cursor while in a batch file.
/U1 should now properly return uppercase filenames in all
Version 3.02, 9/7/90
- When starting a shareware copy of 4DOS there is
a 1/2-second, two-tone beep to identify this as a shareware copy, followed
by a 3-second delay to allow reading of the shareware reminder message.
Beginning with version 3.02, you can skip this
delay by pressing any key.
Features and Usage:
- Several changes have been made in 4DOS's file
handling to eliminate problems with incomplete redirected output files on
- There is a small speedup in description
processing for the file commands (COPY, DEL, MOVE, and REN).
- The "?" character in filename wildcards now
matches zero or more characters like COMMAND.COM instead of one or more
like previous versions of 4DOS. Thus "DIR A?." will match both the files
"A" and "AA"; before it would only match "AA". This change adjusts 4DOS to
work the way COMMAND.COM works instead of the way COMMAND.COM is
documented to work.
- The F3 key now works like COMMAND.COM, so you
can type part of a line and hit F3 to get the rest of the previous line.
- The ECHO state is now inherited properly when
batch files chain. In version 3.01 the echo state was inherited properly
on a CALL, but not on a chain.
- One new internal variable has been added:
0 if no coprocessor is installed
87 for an 8087
287 for an 80287
387 for an 80387
There are a few minor errors or points which are not clear in the list of
variable functions in some versions of the manual:
When using variable functions they must be preceded (and optionally
followed) by a percent sign, like all other environment variables. For
example the "ext" function is referenced as %@ext[filename] or as %@ext[filename]%.
The correct spelling for the string length function is "%@len", not
The %@line function is missing from early copies of the manual. This
function returns the nth line of a file. The first line of the file is
In the %@substr function, the first character is numbered 0, and the
correct syntax is "%@substr[string,start,length]" not "%@substr[string,start,end]".
- Commas will now be ignored by %@eval. This will
allow (for example) %@eval[10,000 * 3] to get the expected result. It will
also allow %@eval to work on the output of a command like FREE, which
contains embedded commas. Also %@eval will give a "Divide by zero" error
message if you try to use 0 as a denominator for division or modulo
calculation; previously it would give an error for the modulo, but return
the numerator as the result for the division.
- %@substr can now handle quotes around the
"string" argument. Double quotes and back quotes are equivalent in this
context, and the quote characters DO count when determining which
characters are placed in the substring. This capability allows you to get
substrings of strings which contain commas. For example:
%@substr["Mon, Aug 27, 1990", 1, 3]
will return "Mon". Previously the commas would be seen as argument
separators, even if they were within a quoted string.
- 3.02 [p 42] Two new variable functions
have been added:
%@upper[string] Returns the string converted to upper case.
%@lower[string] Returns the string converted to lower case.
- Both 4DOS.COM and the 4DOS EXE files now check
for version mismatch (e.g. trying to use version 3.01a 4DOS.COM with a
version 3.02 EXE file). Previously this testing was done by 4DOS.COM only,
so a mismatch could go undetected in some circumstances.
- Divide by zero handling has been removed from
4DOS, allowing standard DOS divide by zero handling to take place. The
4DOS divide by zero handler was not providing any advantage and could
occasionally fail to recover properly from division errors in
- Cursor positioning during command line editing
will now take place in the current video page, rather than assuming page
0. This should fix minor cursor positioning problems with programs that
shell to DOS with the video adapter set somewhere other than page 0 (like
- Handling of the Abort response to a critical
error during a 4DOS command has been modified to solve some obscure
problems with changing floppy disks after Aborting from a disk error.
- DESCRIBE: Problems with missing <cr>s in
description files have been solved. These problems did not cause any
trouble within 4DOS, but 3rd-party description editors were confused by
- DIR: The time separator character will now be
correct when the country code is set for outside the US. Previously it was
hardcoded as a colon.
Problems with occasional "Out of memory" errors
and missing description displays in DIR have been resolved. However, if
you fragment DOS memory (for example by loading two TSRs, then unloading
the first but not the second) you can get "Out of memory" errors in larger
directories as DIR tries to expand the memory it is using to store your
filenames and descriptions. If this occurs, determine the cause of the
fragmentation and resolve it.
- IF and IFF: The string tests will now work
correctly even if the string contains an "=" sign (which is one of the IF
test characters) or a "/" (which is the 4DOS switch character). Also the
EMS test now returns the correct value (0) if there is no EMS driver
present. In version 3.01 it would return a random value.
- LIST: The switches now work properly when
specified without spaces, eg as /WS or /W/S. Previously they required a
space (/W /S) to work correctly.
- SETDOS: The COMPOUND character (SETDOS /C) can
now be any ASCII character except those specified in the manual as not
allowed. Previously characters above ASCII 127 would not work as the
- The text has been modified in many places. An
ANSI table has´been added along with the APPEND, FASTOPEN, GRAPHICS, KEYB,
NLSFUNC, RECOVER, and REPLACE commands, and more information on HELP
itself. The explanations of JOIN and SUBST are more detailed. All resident
commands now show their DOS 3.3 resident size. Several minor typographical
errors have been corrected.
- HELP has two switches which can be set
temporarily on the command line (in version 3.02), or "permanently" --
until explicitly changed -- via the 4HELPC environment variable (see
below). When switches are set on the command line they can be placed
before or after the topic name (if any), so for example these two commands
help copy /r
help /r copy
The switches are:
/BW: Forces HELP to display
all text in monochrome colors, to support the use of monochrome monitors
attached to color video boards (e.g. use of a composite monochrome monitor
on a CGA system). If you have such a system you will probably want to set
the /BW switch permanently as shown under 4HELPC below.
/R: Disables dynamic
window resizing and forces all text screens to be displayed at the full
screen height for those who prefer an unchanging display window size.
Version 3.03, 4/12/91
- 4DOS will now preserve leading whitespace on the
command tail for external commands, and pass no whitespace to the command
if that's how the line is entered. For example, the command:
will pass "/c" to MYPROG; previously an extra space (" /c") was passed.
This should fix occasional problems with programs that can't handle
- There is one additional character which can be
used after the 4DOS escape character (the escape character is normally
ctrl-X): a "t" will mean the ASCII TAB character, so that:
will place a TAB on the line (^X means the single character ctrl-X, which
appears on your screen as an upward-pointing arrow).
Command Line Editing:
- TAB has been added as a synonym for F9, and
Shift-TAB as a synonym for F8. Also the F3 key will now put the cursor at
the end of the command line after recalling the previous command.
- Error levels generated by external programs in
batch files are now returned properly to the calling program when the
batch file is run from a transient 4DOS shell (4DOS /C). This should fix
problems with BBS systems which return error levels through batch files
(also see the EXIT command below for related information).
- 4DOS now does a disk reset following a ^C, or a
MOVE, REN, or DEL command. This should fix problems occasional problems
with disk caches and FASTOPEN.
- BEEP, DELAY: Fixed a bug that could hang the
system if a BEEP or DELAY was active at an even 1/2 hour.
- DATE: If you enter only two digits for the year
and it is below 80, 4DOS will now assume it is in the 21st century; if it
is 80 or above 4DOS will assume it is in the 20th century. You can specify
the year you want explicitly by using a 4-digit value. The system of
using 3-digit year values for dates in the 21st century, as documented in
the printed manual, has been removed. Also DATE now supports the European
date display format (Mon 1.Jan 1991).
- DIR: Fixed an occasional problem with doing a
"DIR ." in the root directory.
- EXIT: EXIT now accepts a numeric argument (EXIT
n). The argument value is returned to the previous program as the error
level. If no argument is given the error level from the most recent
external program will be returned; this is a change from previous versions
of 4DOS, for compatibility with COMMAND.COM.
- FOR: An active FOR is now aborted properly when
a nested batch file CANCELs, or when a batch file chains to another batch
- GOSUB: Previously if a GOSUB was used within an
IFF statement and there was another IFF statement inside the called
subroutine, the two IFF statements could interfere with each other. This
has been corrected; two such IFF statements will now operate independently
of each other. This also means that you can use a GOTO inside the
subroutine without canceling the operation of the IFF statement in the
calling part of the batch file (see next item on GOTO and IFF).
- PROMPT: When displaying the date in the prompt
4DOS now supports the European format (e.g. Mon 1. Jan 1991).
- REN: Fixed a bug which would give an "Invalid
path" error when the only thing specified for the target was ".", as in:
ren \4dos\4dos.doc .
- TIME: An invalid entry will now display an error
message and prompt again, instead of generating an incorrect time value.
- TYPE: TYPE will now stop on a ^Z (end of file
mark), for compatibility with COMMAND.COM.
- Y: "Y:" at the start of the command line will
now refer to drive Y rather than the Y command. This should allow network
users with mapped "Y" drives to execute programs on those drives without
having to disable the 4DOS Y command.
Top of Page -