home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hall of Fame
/
HallofFameCDROM.cdr
/
open
/
4dos20.lzh
/
4DDOC.ARC
/
4DOS.DOC
Wrap
Text File
|
1989-02-28
|
225KB
|
7,235 lines
4DOS Version 2.0 4DOS Version 2.0
A PC-DOS / MS-DOS Command Processor A PC-DOS / MS-DOS Command Processor
Written by:
Rex C. Conn
Tom Rawson
Distributed by:
J.P. Software
P.O. Box 1470
E. Arlington, MA 02174
_______
____|__ | (tm)
--| | |-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
-----| | |---------------------
|___|___| MEMBER
Program and Documentation Copyright (c) 1988, 1989 Rex C. Conn and
J.P. Software. All rights reserved.
Portions Copyright (c) 1987, 1988 Microsoft Corporation.
Published by:
J.P. Software:
P.O. Box 1470
E. Arlington, MA 02174
(617) 646-3975
Electronic mail to:
CompuServe 73577,243
BIX "trawson"
PC-DOS, PC, PC XT, PC AT, and PS/2 are trademarks of IBM
Corporation.
MS-DOS is a trademark of Microsoft Corporation.
1-2-3 is a trademark of Lotus Development Corporation.
dBASE is a trademark of Ashton Tate.
ACKNOWLEDGEMENTS ACKNOWLEDGEMENTS
Special thanks to Dave Lemire, Chris Rousseau and the beta
testers for their invaluable suggestions and debugging
help, and to Lorna Howard for the manual design, layout,
and editing.
4DOS is written in Microsoft C 5.1 and assembly language.
TABLE OF CONTENTS TABLE OF CONTENTS _________________
Introduction i Introduction
Registration Information ii
4DOS License Agreement iii
Limited Warranty v
Order Form vii
Technical Support ix
ASP x
4DOS Features 1 4DOS Features
Installation 8 Installation
Automatic Installation 10
Manual Installation 10
Configuring 4DOS 12
Using 4DOS with DESQView 13
Compatibility Notes 14
Using 4DOS 15 Using 4DOS
Starting 4DOS 15
Command Line Editing 16
Command History & Recall 17
Multiple Commands 18
Conditional Commands 19
Escape Characters 19
Command Echoing 20
Argument Quoting 20
Aliases 20
Keystack 22
Environment Variables 23
I/O Redirection 25
Command Reference Guide 27 Command Reference Guide
? 29
ALIAS 30
ATTRIB 32
BEEP 33
BREAK 34
CALL 35
CANCEL 36
CD / CHDIR 37
CDD 38
CHCP 39
CLS 40
COPY 41
DATE 42
DEL / ERASE 43
DESCRIBE 44
DIR 45
DIRS 47
ECHO 48
ENDLOCAL 49
ESET 50
EXCEPT 51
EXIT 52
FOR 53
FREE 54
GLOBAL 55
GOSUB 56
GOTO 57
HELP 58
HISTORY 59
IF 60
INKEY 62
INPUT 63
KEYSTACK 64
LIST 65
MD / MKDIR 66
MEMORY 67
MOVE 68
PATH 69
PAUSE 70
POPD 71
PROMPT 72
PUSHD 73
QUIT 74
RD / RMDIR 75
REM 76
REN / RENAME 77
RETURN 78
SCREEN 79
SELECT 80
SET 81
SETDOS 82
SETLOCAL 84
SHIFT 85
TEE 86
TEXT 87
TIME 88
TIMER 89
TYPE 90
UNALIAS 91
VER 92
VERIFY 93
VOL 94
Y 95
Appendices Appendices
A Error messages 96
B ANSI commands 102
C Extended key codes 105
Index 106 Index
Introduction Introduction
Welcome, and thanks for trying 4DOS!
4DOS is designed to help you get the most out of your IBM
PC or compatible system. It replaces COMMAND.COM, the
command interpreter that comes with all versions of MS-DOS
and PC-DOS.
You'll find 4DOS provides a wide variety of capabilities
COMMAND.COM can't, ranging from a vastly enhanced DIR
command, to point-and-shoot file selection for any command,
to the ability to completely redefine your system's
commands. Yet 4DOS is fully compatible with COMMAND.COM.
4DOS is a "DOS shell" (a program that gives you access to
DOS functions and commands), but it's unlike most DOS
shells on the market. Virtually all of these shells are
designed to isolate the novice user from the DOS command
line. 4DOS, on the other hand, is intended to make DOS
easier to use and to make you more productive while working
at the command line. It provides enhancements to most of
the DOS commands, as well as over 30 new commands. These
improvements make 4DOS a much richer and more powerful
environment to work in than COMMAND.COM, without
sacrificing the compatibility, flexibility, and control you
get from working at the command line. If you're tired of
the limitations of COMMAND.COM, you'll love 4DOS!
4DOS is distributed as shareware, which means if you've _________
downloaded it from a bulletin board or obtained it from a
friend, you can try it out before you decide whether you'd
like to keep it. Like all shareware, if you do decide to
keep 4DOS, you must pay a registration fee.
The following pages include registration information, the
4DOS license agreement and registration form, and
information on technical support for 4DOS, and on the
Association of Shareware Professionals (ASP).
4DOS Reference Manual i
Registration Information Registration Information
4DOS is a copyrighted program protected by both U.S. and
international copyright law. You are authorized to use it
without charge for a limited period of time under the terms
of the 4DOS license agreement. After this time is up, you
must register and pay for 4DOS to continue using it.
This method of distribution is known as shareware. It _________
allows you to determine whether 4DOS meets your needs
before you pay for it.
The registration fee for a single copy of 4DOS is $50.
Payment of this fee entitles you to:
∙ A disk with the latest version of 4DOS, registered
to you.
∙ A version of 4DOS optimized for 80286/80386
processors.
∙ One copy of the printed and bound 4DOS manual.
∙ An upgrade to the next version of 4DOS for free, and
reduced rates on future upgrades.
∙ Technical support via electronic mail or telephone.
If you prefer, you may register for $35 and receive only
the disk and notices of future upgrades. Network, site,
and corporate licenses are also available; contact J.P.
Software for more information.
4DOS Reference Manual ii
4DOS License Agreement 4DOS License Agreement
(1) The 4DOS program and all other programs and
documentation distributed or shipped with it are
copyrighted works protected by U.S. and international
copyright law. In the rest of this document, this
collection of programs is referred to simply as "4DOS".
You are granted a license to use your copy of 4DOS only
under the terms and conditions specified in this license
agreement.
(2) 4DOS is a commercial software package. It is not not
free, and it is not in the public domain. It is not
distributed as shareware, which means that before you pay shareware _________
for the package, you may try it and see if you want to
continue using it. You may use 4DOS free for a trial
period of up to 21 days. If you wish to continue using
4DOS after that period, you must pay a registration fee.
If you choose not to pay the registration fee, you must
stop using 4DOS and remove it from your computer, though
you are still free to keep copies and pass them along to
others.
(3) You may use your copy of 4DOS on a single computer.
You may also install it on a computer attached to a
network, or remove it from one computer and install it on a
different one, provided there is no possibility that a
single copy of 4DOS will be used on more than one computer
at a time. Network, site, and corporate licenses are
available from J.P. Software.
(4) You may copy 4DOS for backup purposes, and you may
give copies of the unregistered version to other unregistered
individuals, which they may also use and copy under the
terms of this agreement. If you copy the unregistered
version of 4DOS for others, you must include all of the all
files distributed with it.
(5) You may NOT give, sell, or otherwise transfer copies
of the registered version of 4DOS to any other person for registered
any reason. However, you may transfer ownership of your
registered copy to another person, provided that when you
do so, you stop using 4DOS and remove it from your
computer, and notify J.P. Software of the new owner.
(6) You may NOT distribute 4DOS other than through
individual copies of the unregistered version passed to unregistered
friends and associates for their individual use.
Specifically, you may not place 4DOS or any part of the
4DOS package in any user group or commercial library
without express written permission from J.P. Software, and
4DOS Reference Manual iii
you may not distribute for a fee, or in any way sell copies
of 4DOS or any part of the 4DOS package.
(7) 4DOS is a powerful program. While we have attempted
to build in reasonable safeguards, if you do not use 4DOS
properly you may destroy files or cause other damage to
your computer software and data. You assume full You assume full
responsibility for the selection and use of 4DOS to achieve responsibility for the selection and use of 4DOS to achieve
your intended results; in no event shall J.P. Software be your intended results; in no event shall J.P. Software be
responsible for any damages whatsoever due to errors in responsible for any damages whatsoever due to errors in
usage or your failure to read, understand, or follow usage or your failure to read, understand, or follow
instructions in the documentation. J.P. Software limits instructions in the documentation.
its warranty to replacement of a defective program diskette
or manual.
(8) Like all useful computer software, 4DOS may contain
errors in programs or documentation. If you find such an
error or are otherwise dissatisfied with a registered copy
of 4DOS, you may return the entire package at any time up
to one year after purchase for a full refund of your
original registration fee; such a refund shall be your sole
remedy for any program error(s). J.P. Software shall not
be liable for any other costs incurred by you due to such
errors.
(9) If you do not agree with these terms and conditions,
you do not have permission from the copyright holder(s) to
use 4DOS, and you must stop using it and remove it from
your computer.
(10) Any use or distribution of 4DOS which violates this
license agreement will be considered a copyright violation,
and prosecuted to the full extent of the law.
4DOS Reference Manual iv
Limited Warranty Limited Warranty
J.P. Software warrants that the 4DOS diskette and manual
distributed to registered users are fit for the purpose for
which they are intended. J.P. Software will replace or
refund the purchase price of the diskette and/or manual
and/or any other parts or components of 4DOS found to be
defective or not able to be used for the purpose for which
they are intended, if such defect is the fault of J.P.
Software and not the result of misuse or abuse, and if the
defective items are returned to J.P. Software within the
warranty period of one year.
J.P. Software makes no other warranties, express or
implied, and J.P. Software's warranty is expressly limited
to the cost of replacement of any defective diskette or
other part.
4DOS Reference Manual v
Registration Form Return to: J.P. Software
P.O. Box 1470
E. Arlington, MA 02174
4DOS Version 2.0 Quantity Price
Disk, manual, and next update ($50.00) _______ _______
Disk only ($35.00) _______ _______
Subtotal _______ _______
Sales tax (MA only, 5%) _______
Shipping outside US ($5) _______
Total enclosed _______
Please specify 5.25 _____ or 3.5 _____ diskette.
Credit card orders (MasterCard / VISA ONLY):
Card Number _____________________ Expires _______
Signature _____________________
Credit card customers may also order by phone by calling (617)
646-3975 between 9:00 AM and 5:00 PM Eastern time, or by EMAIL.
Check here to have us contact you about multi-system licenses ___
Terms: All payments must be in U.S. funds. All credit card
charges will be authorized; credit cards are not charged until
your order is shipped. Personal checks may be subject to bank
clearance delay before shipment.
Name _______________________________________________
Company _______________________________________________
Address _______________________________________________
_______________________________________________
_______________________________________________
Phone _____________________
I have read and agree to abide by the 4DOS license agreement:
(Signature) ________________________________________
Where did you get 4DOS?__________________________________
Please use the back of this page for any comments or
suggestions.
4DOS Reference Manual vi
Technical Support Technical Support
Technical support for 4DOS is available to registered users
ONLY! If you are not a registered user, we will provided
limited assistance to help you get 4DOS installed if you
contact us via electronic mail (see below).
If you are a registered user, you can contact J.P. Software
for support at the following electronic addresses:
CompuServe: Easyplex to 73577,243
BIX: Mail to "trawson"
Or we can be reached via U.S. Mail at:
J.P. Software
P.O. Box 1470
E. Arlington, MA 02174
We strongly prefer support via electronic mail, as it
allows correspondence at convenient times regardless of
time zones and work schedules, and it provides a record of
the communication. However, telephone support is also
provided to those users who do not have a modem or an
account on one of the electronic mail systems listed above.
You can call us at (617) 646-3975 between 9:00 AM and 5:00
PM Eastern time. We will respond to telephone messages as
quickly as possible, but may require 48 hours or more
depending on the workload and the timing of your call.
4DOS Reference Manual vii
Association of Shareware Professionals Association of Shareware Professionals
The authors and publisher of 4DOS are members of the
Association of Shareware Professionals (ASP), an
organization formed in April 1987 to strengthen the future
of shareware as an alternative to commercial software. Its
members, all of whom are programmers who subscribe to a
code of ethics, are committed to the concept of shareware
as a method of marketing.
The ASP's Standards for its members and their shareware
products are:
Programming Standards Programming Standards
The program meets the ASP's definition of "shareware"
(i.e., it is not a commercial demo with a major
feature disabled, nor a time-limited program).
The program has been thoroughly tested by the author
and should not be harmful to other files or hardware
if used properly.
Documentation Standards Documentation Standards
Sufficient documentation is provided to allow the
average user to try all the major functions of the
program.
Any discussion of the shareware concept and of
registration requirements is done in a professional
and positive manner.
Support Standards Support Standards
The member will respond to people who send
registration payments, as promised in the program's
documentation. At a minimum, the member will
acknowledge receipt of all payments.
The member will establish a procedure for users to
report, and have acknowledged, matters such as bug
reports, and will describe such means in the
documentation accompanying all versions of the
programs. The author will respond to written bug
reports from registered users when the user provides a
self-addressed, stamped envelope.
Known incompatibilities with other software or
hardware and major or unusual program limitations are
noted in the documentation that comes with the
shareware (evaluation) program.
4DOS Reference Manual viii
ASP Ombudsman Information ASP Ombudsman Information
This program is produced by members of the Association
of Shareware Professionals (ASP). ASP wants to make
sure that the shareware principle works for you. If
you are unable to resolve a shareware-related problem
with an ASP member by contacting the member directly,
ASP may be able to help. The ASP ombudsman can help
you resolve a dispute or problem with an ASP member,
but does not provide technical support for members'
products. Please write to the ASP Ombudsman at:
ASP Ombudsman
P.O. Box 5786
Bellevue, WA 98006
or send a Compuserve message via Easyplex electronic
mail to the ASP Ombudsman, Compuserve ID number
70475,1071.
4DOS Reference Manual ix
4DOS Features 4DOS Features
4DOS is a complete replacement for COMMAND.COM, the command
processor provided with MS-DOS or PC-DOS. (References in this
manual to MS-DOS also apply to PC-DOS.) 4DOS is compatible
with MS-DOS and COMMAND.COM, and adds many enhancements and new
commands, including:
Minimal Memory Usage Minimal Memory Usage
4DOS has a swapping option that requires less than 5K of
your precious RAM for its resident portion, and can use
either EMS memory or disk for swapping its transient
portion.
On-line Help On-line Help
4DOS provides help for all of its internal commands, as
well as the MS-DOS external commands.
Command Line Editing Command Line Editing
4DOS provides command line editing, including insert and
delete, and full cursor key support. 4DOS also offers
interactive expansion of wildcard filenames on the
command line.
Command History Command History
4DOS lets you view, search, modify, and reexecute your
previous commands. The commands are saved in memory, and
can be recalled with the cursor keys. The command
history list size is user-defined, from 512 to 8192
characters.
Flexible File Wildcards Flexible File Wildcards
4DOS offers more flexible wildcards than COMMAND.COM.
For example, you can display all the files that have a
"2" anywhere in their filename by entering:
dir *2*.* dir *2*.*
4DOS Reference Manual 1
File Descriptions File Descriptions
4DOS allows you to give descriptions (up to 40
characters) to each of your files. The descriptions will
be displayed with the filenames when you use the DIR or
SELECT commands.
Multiple Commands on a Single Line Multiple Commands on a Single Line
You can enter several commands on a line by separating
them with a ^ (caret), or other user-defined character. ^
Expanded and Editable Environment Expanded and Editable Environment
4DOS provides an environment size from 512 to 32000 bytes
(user defined). You can interactively edit environment
entries with the ESET command.
Environment Variables Environment Variables
Environment variables allow you to associate a string of
characters with a variable name, substituting that string
when the name is used. 4DOS provides a number of
predefined variables, including system date and time,
current directory, and default disk.
Aliases Aliases
Aliases allow you to rename or reconfigure commands (for
example, to pass default parameters to a command, or to
give MS-DOS the look and feel of a different operating
system); or to define a new command as a combination of
several other commands. Aliases support batch file-like
arguments (%1, %2, etc.) and environment variables, so
when combined with the multiple commands feature, they
act as very fast batch files.
Expanded Command Line Expanded Command Line
4DOS expands the MS-DOS command input line from 127 to
255 characters for internal commands. Because MS-DOS
truncates the command line for external commands to 127
characters, 4DOS makes the full command line available
through the CMDLINE environment variable.
4DOS Reference Manual 2
Conditional Commands Conditional Commands
4DOS includes two new command line operators: || (OR) and ||
&& (AND). They allow you to control the execution of &&
subsequent commands based on the result of the previous
command.
Additional Redirection Options Additional Redirection Options
In addition to redirection of standard input and standard
output, 4DOS supports redirection of standard error, and
the option to prevent overwriting existing files. 4DOS
also provides UNIX-like TEE and Y pipes.
EGA/VGA Support EGA/VGA Support
4DOS supports Monochrome, CGA, EGA and VGA displays with
any number of lines and columns per screen.
Networks Networks
4DOS supports MS-DOS compatible networks.
4DOS Reference Manual 3
New and Enhanced Commands New and Enhanced Commands
4DOS provides many new internal commands, and new options for
existing commands. Most 4DOS commands can take multiple
arguments. For example, you can delete several files with a
single DEL command:
del *.bak test.wks oldfile.txt del *.bak test.wks oldfile.txt
You can also copy several files with a single COPY command
(the target directory here is a:\): a:\
copy *.wks memo.doc *.c a:\ copy *.wks memo.doc *.c a:\
The following list is intended to give you a sampling of the
new commands. See the Command Reference Guide for full
details.
ALIAS / UNALIAS ALIAS / UNALIAS
Define aliases for commonly used commands, allowing you
to execute a complex series of commands with a few
keystrokes.
ATTRIB ATTRIB
Display or change the file attributes (read-only, hidden,
system, and archive) for the specified files and/or
directories.
CDD CDD
Change the default drive and directory.
DESCRIBE DESCRIBE
Add 40-character descriptions to filenames. The
descriptions are displayed using DIR and SELECT.
DIR DIR
Display the disk directory with a wide variety of
options, including 1, 2, or 5 column display; sorted by
name, extension, size, or date/time; display
subdirectories; display file attributes; and display
subtotals only.
ESET ESET
Interactively edit environment variables and aliases.
4DOS Reference Manual 4
EXCEPT EXCEPT
Execute a command except on the specified file(s).
FREE FREE
Display the total and free disk space.
GLOBAL GLOBAL
Execute a command in the current directory and all of its
subdirectories.
HELP HELP
Display a pop-up help window for 4DOS internal commands
and MS-DOS external commands.
HISTORY HISTORY
Display or clear the command history list.
LIST LIST
Display a file on the screen. LIST provides forward and
backward paging, vertical and horizontal scrolling, and
text search.
MEMORY MEMORY
Display the amount of total and available RAM, expanded
and extended memory, and environment space.
MOVE MOVE
Move files between directories and/or drives.
PUSHD / POPD / DIRS PUSHD / POPD / DIRS
Use a "directory stack" to change directories, perform
some work, and then return to the original directory.
RENAME RENAME
In addition to renaming files, 4DOS also allows you to
rename files to another directory, and to rename
directories.
SELECT SELECT
Perform a command on selected files (using point-and-
shoot selection).
4DOS Reference Manual 5
SETDOS SETDOS
Configure the 4DOS internal parameters, including the
default line editing mode (insert or overstrike), the
default batch echo mode, the compound command character,
and the escape character.
TEE TEE
A "pipe fitting" that copies standard input to standard
output, and saves a copy in the specified file(s).
TIMER TIMER
A system stopwatch for timing events.
Y Y
A "pipe fitting" that copies standard input to standard
output, and then copies the specified file(s) to standard
output.
4DOS Reference Manual 6
Enhanced Batch Processor Enhanced Batch Processor
The batch processor in 4DOS is compatible with batch files
written for COMMAND.COM, and includes several new and enhanced
commands to make batch file programming easier and more
powerful, including:
CALL CALL
Execute nested batch files without loading a
secondary copy of the command processor.
CANCEL CANCEL
Terminate nested batch file processing.
GOSUB / RETURN GOSUB / RETURN
Call subroutines within a batch file.
IF IF
Several new comparison tests, and ignores case in
the string tests.
INPUT / INKEY INPUT / INKEY
Input variables from the keyboard while in a batch
file.
KEYSTACK KEYSTACK
Send keystrokes to a program, as if entered from the
keyboard.
QUIT QUIT
Exit the current batch file.
SCREEN SCREEN
Position the cursor and (optionally) display some
text.
SETLOCAL / ENDLOCAL SETLOCAL / ENDLOCAL
Define a local environment within a batch file,
saving the original environment, disk, and directory,
and restoring them when finished.
SHIFT SHIFT
Optionally specify how many positions to shift,
including reverse SHIFTs.
TEXT / ENDTEXT TEXT / ENDTEXT
Display a block of text.
4DOS Reference Manual 7
Installation Installation
4DOS is written for the IBM PC, PC/XT, PC/AT, PS/2 (all
models), and compatibles. It requires MS-DOS 2 or above (MS-
DOS 3 or above is recommended), and uses a total of about 54K
of memory (4K resident when using the swapping version of
4DOS).
The following files are included on your distribution disk:
INSTALL.BAT* The automatic installation batch file. INSTALL.BAT
4DOS.COM The 4DOS shell loader for expanded memory (EMS) 4DOS.COM
or disk swapping.
4DOS88.EXE Replaces COMMAND.COM as your default MS-DOS 4DOS88.EXE
command processor on any PC compatible
system.
4DOS286.EXE* A version of 4DOS for 80286 and 80386 4DOS286.EXE*
processors. 4DOS286.EXE is smaller and
faster than 4DOS88.EXE.
ANSI.SYS Replaces the standard MS-DOS ANSI driver. ANSI.SYS
It includes more ANSI command sequences,
EGA/VGA support, and runs 20% to 50%
faster.
KEYSTACK.SYS This device driver provides the support for the KEYSTACK.SYS
4DOS KEYSTACK command.
HELP.EXE This is the on-line help program for 4DOS. HELP.EXE
It provides help for all of the internal 4DOS
commands, and for the external MS-DOS
commands.
DOS.HLP The text file for HELP.EXE. DOS.HLP
FIXSTACK.EXE A utility for fixing the "stack overflow" FIXSTACK.EXE
problems some programs experience when using
a large environment.
FIXSTACK.DOC Documentation file for FIXSTACK.EXE FIXSTACK.DOC
4DOS Reference Manual 8
ALIASES.BAT Sample predefined 4DOS aliases. ALIASES.BAT
4D-PIF.DVP DESQview 2.01 .PIF file for 4DOS. 4D-PIF.DVP
README.DOC Last-minute revisions and bug reports. README.DOC
* These files are included only with the registered version
of 4DOS.
4DOS Reference Manual 9
Automatic Installation Automatic Installation
If you have a registered copy of 4DOS, insert the 4DOS System ___________
Disk in drive A, and type: ____
a:install a:install
INSTALL will prompt you for your desired configuration, copy
the necessary files to your boot disk, save your existing
CONFIG.SYS file and create a modified version. Reboot your
system to start 4DOS.
NOTE: You may want to edit the new CONFIG.SYS if you have an
unusual configuration, or if you want to modify the default
values.
Manual Installation Manual Installation
If you have an unregistered copy of 4DOS, or if you prefer to
install 4DOS manually, you will need to copy 4DOS88.EXE (or
4DOS286.EXE), 4DOS.COM, KEYSTACK.SYS, ANSI.SYS, DOS.HLP, and
HELP.EXE to your boot disk. If you prefer, you can use any
compatible version of ANSI.SYS.
The following commands should be included in your CONFIG.SYS
file:
device=ansi.sys device=ansi.sys
device=keystack.sys device=keystack.sys
There are two ways to load 4DOS. The memory resident version
requires about 55K, and is recommended for floppy disk systems
without EMS memory, or those without serious memory
constraints. The swapping version can swap itself to and from
EMS memory or disk when running an application, and requires
less than 5K of DOS memory.
4DOS Reference Manual 10
Manual Installation - Swapping Manual Installation - Swapping
To install the swapping version of 4DOS with MS-DOS Version 3
or above, add the following line to your CONFIG.SYS file:
shell=c:\4dos.com /S:E /p shell=c:\4dos.com /S:E /p
If you are using MS-DOS Version 2.x, add the following line to
your CONFIG.SYS file:
shell=c:\command.com /c c:\4dos /p shell=c:\command.com /c c:\4dos /p
If you are installing 4DOS onto a floppy disk, replace "C:"
with "A:".
4DOS.COM determines the processor type automatically, and
loads 4DOS286 on 80286 or 80386 processors. If 4DOS can't
find 4DOS286, or if your processor is an 8086 or 8088, 4DOS
loads 4DOS88.
There are several startup options for 4DOS:
/I:nn The interrupt number 4DOS uses to communicate with /I:nn
4DOS88 (or 4DOS286); nn can be any number from 60 __
to 66 (hex). The default is the first available
interrupt starting at 60.
/L:d:path Tells 4DOS where to find 4DOS88 (or 4DOS286). The /L:d:path
default is the root directory on the boot drive.
/S:E Swap to EMS memory (default). /S:E
/S:D Swap to disk (creates a swap file called /S:D
4DOSSWAP.@@@ in the root directory of the boot
drive).
If 4DOS attempts a swap to EMS, and the EMS driver is not
present or sufficient EMS memory cannot be allocated, 4DOS
will use disk swapping. If 4DOS can't create the swap file,
it will load 4DOS88 (or 4DOS286) with swapping disabled. 4DOS
will display the interrupt and type of swapping being used.
4DOS Reference Manual 11
Manual Installation - Memory Resident Manual Installation - Memory Resident
To install the memory resident version with MS-DOS Version 3
or above, copy 4DOS88.EXE (or 4DOS286.EXE) to your boot disk,
and add the following line to your CONFIG.SYS file for 8086 or
8088 based machines:
shell=c:\4dos88.exe /p shell=c:\4dos88.exe /p
or for 80286 or 80386 based machines:
shell=c:\4dos286.exe /p shell=c:\4dos286.exe /p
If you are using MS-DOS Version 2.x, add the following line to
your CONFIG.SYS file:
shell=c:\command.com /c c:\4dos88 /p shell=c:\command.com /c c:\4dos88 /p
or for 80286 or 80386 based machines:
shell=c:\command.com /c c:\4dos286 /p shell=c:\command.com /c c:\4dos286 /p
Configuring 4DOS Configuring 4DOS
There are four startup options for 4DOS (these options should
follow 4DOS.EXE on the "shell=" line in CONFIG.SYS):
/H=n Set the history size, where n is the size of the /H=n _
history list. (The default value is 1024
characters, the range is 512-8192 characters.)
/E=n Set the environment size, where n is the size of the /E=n _
environment. (The default value is 1024
characters, the range is 512-32000 characters.)
/P Load 4DOS permanently, and run AUTOEXEC.BAT. /P
4DOS will NOT run AUTOEXEC.BAT without a /P.
/C cmd Load a transient copy of 4DOS, and execute cmd. /C cmd ___
4DOS will not attempt to process any startup
options after a /C.
4DOS Reference Manual 12
Using 4DOS with DESQview Using 4DOS with DESQview
We have included a .PIF file (4D-PIF.DVP) for using 4DOS with
Quarterdeck's DESQview multitasking and windowing system.
This file was created under DESQview Version 2.01. You will
have to use the Add a Program option to add 4DOS to your _____________
DESQview Open Window menu. To do this, select the Add a
Program option, then press the "O" key (for Other Program) and _____________
fill in the drive and directory where 4DOS is located in the
space for "Path." Press ENTER, mark 4DOS using the space bar,
and press ENTER again. For more details, see pages 60 - 61 of
the DESQview Version 2.01 manual.
You must use DESQview's Change a Program option before opening ________________
a 4DOS window, to set the proper program name, parameters, and
startup directory. The field values in the .PIF file should
be considered as examples only. You may also need to adjust
the memory size allocated to 4DOS, depending on what you want
to do in the 4DOS window. The 4D-PIF.DVP file invokes a
startup batch file, DVSTART. The commands in this file will
be executed each time a 4DOS window is opened.
4DOS Reference Manual 13
Compatibility Notes Compatibility Notes
We have tested 4DOS extensively in a variety of environments,
including 8088, 8086, V20, V30, 80286, and 80386 processors;
as a replacement for COMMAND.COM and as a shell run under
COMMAND.COM; in the MS-DOS compatibility box of OS/2; and on
networks. If you find what appears to be a compatibility
problem with 4DOS, please contact us. We will do our best to
fix it, or if necessary we will refund your registration fee.
There is an incompatibility between 4DOS and versions 2.5 or
earlier of the programs MARK, FMARK, and RELEASE, which are
part of the shareware package TSRCOM.ARC from TurboPower
Software. The problem has been fixed in Version 2.6 of
TSRCOM, included with your registered copy of 4DOS.
4DOS stores both aliases and environment variables in the
environment. If you have a large environment (> 1K), this can
cause stack problems with some programs. Many compilers
(such as Microsoft C) save the environment in the stack when
the program starts. The default program stack size is usually
2K; when combined with a large user environment (see the /E
startup option in INSTALLATION), this will generate a "Stack
Overflow" error message. We have included a program
(FIXSTACK.EXE) to patch these programs. We recommend
increasing the default program stack size by at least the size
of the environment.
4DOS Reference Manual 14
Using 4DOS Using 4DOS
This section briefly reviews 4DOS features, and provides some
examples of how 4DOS can help improve your productivity, and
make your computer easier to use. It only covers a few of the
many ways 4DOS can be used, but it should help you start
thinking about the possibilities.
Starting 4DOS Starting 4DOS
Whenever 4DOS is loaded, it searches the boot directory for
the file 4START.BAT, and executes it if found. If 4DOS is
started with the /P option, it will then execute AUTOEXEC.BAT.
Because 4START.BAT is always executed at startup, it provides
a convenient place to put the 4DOS configuration commands (for
example, SETDOS parameters) that would otherwise not be set
when executing a secondary copy of 4DOS. (For example, from a
program shelling to MS-DOS.) (See the Command Reference Guide
for more information on SETDOS.)
When setting up 4START.BAT and AUTOEXEC.BAT, we recommend you
break up the work to be done into smaller batch files. In
particular, if you put the path, aliases, and environment
variables into separate batch files and use CALL to invoke
them, you can edit and reinvoke them later without having to
reboot the system.
4DOS Reference Manual 15
Command Line Editing Command Line Editing
4DOS provides a 255 character command line, with full editing
capability. The following keys have special meanings (the
caret ^ means press the Control key together with with the ^
specified key):
Left Arrow Move the cursor left one character. Left Arrow
Right Arrow Move the cursor right one character. Right Arrow
Up Arrow Recall the previous command from the history Up Arrow
list, or match a partial command entry with a
history list entry (see Command History and
Recall).
Down Arrow Recall the next command from the history list, Down Arrow
or match a partial command entry with a
history list entry (see Command History and
Recall).
^Left Arrow Move the cursor left one word. ^Left Arrow
^Right Arrow Move the cursor right one word. ^Right Arrow
Home Move the cursor to the beginning of the line. Home
^Home Delete from the beginning of the line to the ^Home
character preceding the cursor.
End Move the cursor to the end of the line. End
^End Delete from the cursor to the end of the line. ^End
Ins Toggle between insert and overstrike mode. Ins
Del Delete the character at the cursor. Del
Backspace Delete the character to the left of the cursor. Backspace
CR or LF Execute the command. CR LF
Esc Erase the entire line. Esc
^C Abort the command. ^C
^K Save the command to the history list without ^K
executing it, and erase the line.
F1 Call the on-line help (HELP.EXE). F1
F9 and F10 Scan the filename (which may include the MS-DOS F9 F10
wildcard characters * and ?) at or immediately
to the left of the cursor position, and
replace it with the first matching filename.
Press F9 again to replace it with the next
matching filename. Press F10 to append the
next matching filename at the current cursor
position. If you don't enter a filename, F9
will default to *.*. If you don't enter an *.*
extension, F9 will append a .*. .*
Anything else Enter that character at the cursor position.
4DOS Reference Manual 16
Command History and Recall Command History and Recall
4DOS saves each command into a command history list as it is
entered, allowing you to display, recall, search, and modify
previous commands.
The history list size is determined by the /H parameter at
startup time (see INSTALLATION). The history is a circular
list; when the history list is full, 4DOS discards the oldest
command before adding the newest.
The command history can be displayed or cleared with the
HISTORY command. The /H option in SETDOS allows you to enable
or disable the history saves, and to specify a minimum length
to save. (See the Command Reference Guide for more
information on HISTORY and SETDOS.)
The simplest use of the command history is to repeat commands
exactly. For example, you might enter the command:
dir /2p b:*.wks b:*.doc dir /2p b:*.wks b:*.doc
and then you move some files to or from the B drive. When
you're through, you want to repeat the DIR command. Just use
the up-arrow to scan back through the history list; when the
DIR command appears, press ENTER to reexecute it.
After you've found the command, you can also edit it before
pressing ENTER. This provides a simple means of executing a
series of commands that differ only slightly from each other.
Another powerful feature is command completion, which searches __________________
the command history for the last command that begins with the
characters you entered. In the above example, you can quickly
recall the DIR command by typing DI, and pressing the up
arrow. 4DOS will display the most recent command in the
history list that begins with DI. Pressing the up arrow again
will display the next most recent match. Typing DI and
pressing the down arrow key instead would search for the
oldest matching command in the history list. 4DOS will beep
if there are no matching commands.
4DOS Reference Manual 17
4DOS also provides filename completion. For example, suppose ___________________
you want to copy a file. You remember that the name starts
with AU, but you can't remember the rest. Enter: __
copy au* copy au*
and press the F9 key. The first filename that starts with AU __
will be inserted in the command line. If it's the right file,
simply complete your command. If it's not, press F9 again to
substitute the next matching filename. The F10 key saves the
current filename, and then appends the next matching filename
to the command line. 4DOS will beep when there are no more
matching filenames.
Multiple Commands Multiple Commands
You may enter multiple commands on a single line. The default
command separator is a caret (^). For example, the following
command displays a directory and then copies files to the root
directory on drive A:
dir *.bat ^ copy *.bat a:\ dir *.bat ^ copy *.bat a:\
The command separator character can be changed by setting the
COMPOUND variable (see the SETDOS command in the Command
Reference Guide).
4DOS Reference Manual 18
Conditional Commands Conditional Commands
When an internal or external command finishes, it returns a
result, called the exit code. The conditional commands allow
you to perform tasks based upon the previous command's exit
code. (See also the IF ERRORLEVEL command in the Command
Reference Guide.)
If two commands are separated by && (AND), the second command &&
will be executed only if the first returns an exit code of 0.
If two commands are separated by || (OR), the second command ||
will be executed only if the first returns a non-zero exit
code.
NOTE: All 4DOS internal commands set an exit code, but not
all external programs do. Conditional command behavior will
be unpredictable for programs that don't explicitly return an
exit code.
For example, if the BACKUP operation fails, the files will not
be erased:
backup c:\ a: /s && global erase *.bak *.lst backup c:\ a: /s && global erase *.bak *.lst
If the BACKUP operation fails, then ECHO will display a
message:
backup c:\ a: /s || echo Error in the backup! backup c:\ a: /s || echo Error in the backup!
Escape Character Escape Character
4DOS has a user-definable escape character. The default is
^X, but another character can be used by setting the ESCAPE ^X
variable (see the SETDOS command in the Command Reference
Guide). 4DOS assumes special meanings when these characters
follow the escape character on the command line:
b backspace b
e the ASCII ESC character (27 decimal) e
f formfeed f
n linefeed n
r carriage return r
Any other character preceded by the escape character is copied
directly to the command line and the escape character is
removed. This allows you to suppress the normal
interpretation of special characters (such as ?, *, /, \, |,
`, >, <, and &).
4DOS Reference Manual 19
Command Echoing Command Echoing
Like COMMAND.COM, 4DOS defaults to ECHO ON in batch files. To
prevent a line from being echoed, preface it with the @
symbol. You can tell 4DOS to default to ECHO OFF by setting
the variable VERBOSE to 0 (see the SETDOS command in the
Command Reference Guide).
4DOS also offers command echoing during keyboard input. If
ECHO is ON, the fully parsed and expanded command line
(including alias and variable expansion) will be displayed
before it is executed.
Argument Quoting Argument Quoting
4DOS normally parses command line arguments by searching for
white space (tabs, blanks, and commas). Command line
arguments enclosed in back quotes (`) or double quotes (") may ` "
contain white space. No special processing (alias or variable
expansion, and I/O redirection) will be performed on
expressions enclosed in quotes, with the exception that
variable expansion WILL be performed inside double quotes.
4DOS will strip back quotes from the command line before
executing the command. Double quotes will be passed through
to the command.
Aliases Aliases
Much of the power of 4DOS comes together when using aliases.
An alias is a new name for a command or combination of
commands. Aliases are defined with the ALIAS command, and
removed with the UNALIAS command. Aliases may be nested;
i.e., an alias can refer to another alias, but they cannot
refer back to themselves. The alias name is limited to no
more than 80 characters, and the alias argument to no more
than 255 characters. (See the Command Reference Guide for
more information on ALIAS and UNALIAS.)
Aliases are expanded before the command line is broken up for
multiple commands, redirection, and conditional commands.
4DOS Reference Manual 20
The simplest type of alias is to give a new name to an
existing command. For example:
alias up cd .. alias up cd ..
defines the alias UP to mean "change to the parent directory". __
Aliases can also create a customized version of a command.
For example, the 4DOS DIR command allows a directory to be
sorted in various ways. The alias:
alias de dir /oe /p alias de dir /oe /p
defines the alias DE to mean "sort the directory by extension, __
pausing after each page."
Aliases can also be used to execute multiple commands; when
used this way they act like very fast, in-memory batch files.
For example, the alias:
alias w `pushd c:\wp ^ wp %1^ popd` alias w `pushd c:\wp ^ wp %1^ popd`
defines the alias W to mean "save the current directory, _
change to the WP directory on C, run the WP program using the
first argument on the command line as a filename, and when
finished, restore the original directory." The back quotes
are required to tell 4DOS this is a single alias with three
commands, rather than three commands on a single line (see
Multiple Commands).
Alias definitions can include replaceable parameters, like
those in batch files. Alias parameters are referenced as %1
to %127, and expand to the matching command line argument.
The parameter %& is a special case, and expands to the
remainder of the command line following the alias name. If an
alias includes replaceable parameters, unreferenced command
line arguments and parameters with no matching command line
argument will be deleted during alias expansion. If an alias
has no replaceable parameters, the command line arguments will
be appended to the alias.
The distribution disk includes a sample batch file
(ALIASES.BAT) which demonstrates a number of useful predefined
aliases.
See the ALIAS command in the Command Reference Guide for more
information on aliases.
4DOS Reference Manual 21
Keystack Keystack
The KEYSTACK command can be used in aliases and batch files to
feed keystrokes to application programs. The most common use
of KEYSTACK is to have a program take certain actions when it
starts. For example, when the alias (this should be entered
on one line):
alias 321 `keystack 0 13 0 13 0 13 0 13 0 13 "/fr" 0 "%1" alias 321 `keystack 0 13 0 13 0 13 0 13 0 13 "/fr" 0 "%1"
13 ^ 123` 13 ^ 123`
is executed as:
321 February 321 February
it loads Lotus 1-2-3, skips the startup screens, and loads the
spreadsheet FEBRUARY.WK1. ____________
KEYSTACK can store up to 255 characters; enough keystrokes to
cause a program to do an entire operation and exit. For
example, the following alias DRPT will run a dBASE report ____
called TIMEREP in the directory DATA (this should be entered _______ ____
on one line):
alias drpt `pushd c:\data ^ keystack "use times index times"
13 "report form timerep to print" 13 "quit" 13 ^ dbase ^
popd`
See the Command Reference Guide for more information on
KEYSTACK.
KEYSTACK.SYS is a small device driver invoked in your
CONFIG.SYS file (see INSTALLATION) and used to support the
KEYSTACK command. You must have KEYSTACK.SYS installed to use
the KEYSTACK command.
4DOS Reference Manual 22
Environment Variables Environment Variables
Environment variables are defined with the SET command. (See
the Command Reference Guide for more information on SET.)
Environment variables are expanded before the command line is
broken up for multiple commands, redirection, and conditional
commands, but after alias expansion has been done.
Variables are referenced in a command by prefacing the
variable name with a percent sign (%). Two percent signs in a
row (%%) signify a percent sign character. To pass a variable
name (instead of the value) to a command (for example, FOR or
INPUT), you must precede it with two percent signs.
Environment variable names may be composed of any alphanumeric
character, plus the underscore character (_).
For example:
c:\> set start=c:\wordproc\myfiles\memos set start=c:\wordproc\myfiles\memos
c:\> dir /w %start dir /w %start
Directory of c:\wordproc\myfiles\memos\*.*
memo1105.txt boardmtg.txt
49,134 bytes in 2 files
3,653,632 bytes free
There are some variable names that have special meanings in
4DOS:
PATH tells 4DOS where to search for executable files (.COM, PATH ____
.EXE and .BAT) not in the current directory. Some ____ ____
applications also use the PATH variable to find their
files.
CMDLINE is the fully expanded 255-character command line. CMDLINE
You can access it from an external program by searching
the environment.
DOSVER is the current MS-DOS version (for example, 3.1). DOSVER
DISK is the current disk (for example, C). DISK
4DOS Reference Manual 23
CWD is the current directory in the format d:\pathname CWD ___________
CWDS has the same value as CWD, except it ensures the CWDS CWD
pathname ends in a backslash (\).
DATE contains the current system date, in the format mm-dd- DATE ______
yy (for the U.S.), dd-mm-yy (Europe), or yy-mm-dd __ ________ ________
(Japan).
TIME contains the current system time in the format TIME
hh:mm:ss. ________
4DOS Reference Manual 24
I/O Redirection I/O Redirection
MS-DOS assumes input comes from the keyboard and output goes
to the display. The keyboard is referred to as the standard
input, and the display is referred to as the standard output.
You can change the default standard input and standard output
by using the < and > symbols on the command line. 4DOS also < >
allows you to redirect the standard error by appending the & &
character.
Normally, when redirecting standard output, if the specified
file doesn't exist, it is created; if it exists, it is
overwritten, and the previous contents are lost. If the
variable NOCLOBBER is set (see the SETDOS command in the
Command Reference Guide), an error message will be displayed
if the file already exists.
For example, to get standard input from a file instead of the
keyboard, append:
< filename < filename
to the command line. To redirect standard output to a file:
> filename > filename
To redirect standard output to a file, overriding the
NOCLOBBER setting:
>! filename >! filename
To redirect standard output and standard error to a file:
>& filename >& filename
To redirect standard output and standard error to a file,
overriding the NOCLOBBER setting:
>&! filename >&! filename
To append standard output to a file, use >> in place of >. If >> >
NOCLOBBER is set, the file must exist before it can be
appended to (unless overridden by a !). Otherwise, 4DOS will !
create the file.
4DOS Reference Manual 25
Pipes allow you to send the output of one command to the input
of another command, by separating the commands with the
vertical bar (|). 4DOS will perform the commands in order |
from left to right.
For example, to use the standard output of command1 as the ________
standard input of command2: ________
command1 | command2 command1 | command2
To use the standard output and standard error of command1 as ________
the standard input of command2: ________
command1 |& command2 command1 |& command2
4DOS also provides TEE and Y "pipe fittings" (see the Command
Reference Guide for more information on TEE and Y).
4DOS Reference Manual 26
Command Reference Guide Command Reference Guide
4DOS has more than 60 internal commands. Some are the same
as, or improvements of, those in COMMAND.COM. The remainder
are new commands.
These commands are equivalent to those in COMMAND.COM:
BREAK CD CHCP CHDIR
CLS DATE EXIT FOR
GOTO TIME VER VERIFY
These commands are enhanced:
COPY DEL DIR ERASE
ECHO ERASE MD MKDIR
PATH PAUSE PROMPT RD
REM REN RENAME RMDIR
SET SHIFT TYPE VOL
These commands are new:
? ALIAS ATTRIB BEEP
CALL CANCEL CDD DESCRIBE
DIRS ENDLOCAL ESET EXCEPT
FREE GLOBAL GOSUB HISTORY
INKEY INPUT KEYSTACK LIST
MEMORY MOVE POPD PUSHD
QUIT RETURN SCREEN SELECT
SETDOS SETLOCAL TEE TEXT
TIMER UNALIAS Y
4DOS Reference Manual 27
Command Syntax Command Syntax
Words in uppercase are keywords and must be entered. Words in
lowercase are variables.
The expression d: represents a disk drive specification. d: __
(This can be A:, B:, C:, etc.).
Words or letters in brackets ([ ]) are optional and are not
required to be entered.
A vertical bar (|) separating words means enter one word or
the other, but not both.
A letter preceded by a / is a switch. Switches are used to
enable or disable the various command options.
An ellipsis (...) means additional arguments are allowed, but
not required.
In the examples in the printed manual, characters in bold type bold
represent input from the user. Characters in normal type
represent 4DOS prompts or responses.
4DOS Reference Manual 28
? ?
Syntax: ? ?
Purpose: Display the 4DOS commands.
Comments: ? will display the 4DOS internal commands. For help
with the internal 4DOS and external DOS commands, use
the HELP command.
Example: Display the internal commands:
c:\> ? ?
? ALIAS ATTRIB BEEP
BREAK CALL CANCEL CD
CDD CHCP CHDIR CLS
COPY DATE DEL DESCRIBE
DIR DIRS ECHO ENDLOCAL
ERASE ESET EXCEPT EXIT
FOR FREE GLOBAL GOSUB
GOTO HISTORY IF INKEY
INPUT KEYSTACK LIST MD
MEMORY MKDIR MOVE PATH
PAUSE POPD PROMPT PUSHD
QUIT RD REM REN
RENAME RETURN RMDIR SCREEN
SELECT SET SETDOS SETLOCAL
SHIFT TEE TEXT TIME
TIMER TYPE UNALIAS VER
VERIFY VOL Y
4DOS Reference Manual 29
ALIAS ALIAS
Syntax: ALIAS [arg1 arg2] ALIAS [arg1 arg2]
Purpose: Display the alias list, or define arg1 as a ____
substitute for arg2. ____
Comments: If you don't specify any arguments, ALIAS displays
the current alias list. If you only specify arg1, ____
ALIAS displays the current alias value for arg1. ____
Otherwise, ALIAS assigns the command(s) in arg2 to ____
arg1. Arg1 can now be used as if it were a built-in or ____ ____
external command. Aliases may be nested; i.e., an
alias can refer to another alias, but they cannot refer
back to themselves (a=b=a).
The alias name is limited to no more than 80
characters, and the alias argument to no more than 255
characters.
Arg2 may contain environment variables or additional ____
aliases.
Alias definitions can include replaceable
parameters, like those in batch files. Alias
parameters are referenced as %1 to %127, and expand to
the matching command line argument. The parameter %&
expands to the remainder of the command line following
the alias name. If an alias includes replaceable
parameters, unreferenced command line arguments and
parameters with no matching command line argument will
be deleted during alias expansion. If an alias has no
replaceable parameters, the command line arguments will
be appended to the alias.
Aliases are useful as a means of executing a complex
series of commands with a few keystrokes. Aliases can
also be used as in memory batch files, and will run
much faster than disk-based batch files.
To remove an alias, use the UNALIAS command.
Example: Define D as an alias for DIR /AP: _ _______
c:\> alias d dir /ap alias d dir /ap
4DOS Reference Manual 30
Display the current alias(es):
c:\> alias alias
d=dir /AP
The following example creates a new command WHEREIS _______
that searches a disk for matching files and
subdirectories:
c:\> alias whereis dir /dp alias whereis dir /dp
The following example is an "in-memory batch file"
that erases the backup files, and then displays the
directory (the back-quotes are necessary to prevent
4DOS from processing the command separator ^):
c:\> alias zap `del *.bak ^ dir /w` alias zap `del *.bak ^ dir /w`
The following examples show the use of alias
arguments:
c:\> alias zap `erase %& ^ chkdsk ^ dir /w` alias zap `erase %& ^ chkdsk ^ dir /w`
c:\> zap *.bak *.lst zap *.bak *.lst
This expands to:
erase *.bak *.lst ^ chkdsk ^ dir /w
c:\> alias reverse `echo %5 %4 %3 %2 %1` alias reverse `echo %5 %4 %3 %2 %1`
c:\> reverse one two three four five reverse one two three four five
This expands to:
echo five four three two one
4DOS Reference Manual 31
ATTRIB ATTRIB
Syntax: ATTRIB [-|+[AHRS]] [d:][path]filename... ATTRIB [-|+[AHRS]] [d:][path]filename...
Purpose: Change the file attributes.
Comments: +A Set the archive attribute
-A Clear the archive attribute
+H Set the hidden attribute
-H Clear the hidden attribute
+R Set the read-only attribute (write-protected)
-R Clear the read-only attribute
+S Set the system file attribute
-S Clear the system file attribute
New attribute values are allowed between file names;
otherwise the file is set to the same attributes as
defined for the previous file(s). You cannot modify
the directory or volume label attributes.
You can display the file attributes using the /A
option in DIR.
Example: Change the file MEMO to read-only and hidden: ____
c:\> attrib +rh memo attrib +rh memo
Set the archive attribute (file has been modified)
for MEMO, and change TEST.COM to system and not ____ ________
modified:
c:\> attrib +a memo +s -a test.com attrib +a memo +s -a test.com
4DOS Reference Manual 32
BEEP BEEP
Syntax: BEEP BEEP
Purpose: Beep the speaker.
Comments: BEEP is normally used in batch files to signal that
an operation has been completed, or that the computer
needs attention (for example, to change disks).
Example: The following batch file fragment runs the program
DEMO, beeps, and waits for you to press a key: ____
demo
beep
pause Finished with the demo - hit a key...
4DOS Reference Manual 33
BREAK BREAK
Syntax: BREAK [on | off] BREAK [on | off]
Purpose: Display, enable, or disable ^C / ^BREAK checking.
Comments: BREAK turns the ^C / ^BREAK checking on or off. If
no argument is given, it displays the current BREAK
status.
If BREAK is off, MS-DOS will only check for a ^C
during screen, keyboard, serial port, or printer I/O
operations. Many programs don't use the MS-DOS
functions to access the screen and keyboard, and it can
be difficult to break out of them with BREAK off. If
BREAK is on, MS-DOS will check for a ^C or ^BREAK
during any MS-DOS operation (including disk access).
BREAK defaults to OFF. You can change the default
BREAK setting by adding the following line to your
CONFIG.SYS file:
BREAK=ON BREAK=ON
Example: Check the current BREAK status:
c:\> break break
BREAK is OFF
Enable ^C checking in all MS-DOS calls:
c:\> break on break on
4DOS Reference Manual 34
CALL CALL
Syntax: CALL [d:][path]filename CALL [d:][path]filename
Purpose: Call a secondary batch file.
Comments: CALL allows batch files to call other batch files
(batch file nesting) without invoking a secondary copy
of the command processor. 4DOS supports batch file
nesting up to 5 levels deep. The calling batch file is
suspended while the called batch file runs. When the
called batch file finishes, the calling batch file
resumes execution at the next command.
See also CANCEL and QUIT.
Example: The following batch file fragment compares an input
line to "wp" and calls a secondary batch file if it
matches:
input Enter your choice: %%option
if "%option" == "wp" call wp.bat
4DOS Reference Manual 35
CANCEL CANCEL
Syntax: CANCEL CANCEL
Purpose: Terminate batch file processing.
Comments: The CANCEL command will end all batch file
processing, regardless of the batch nesting level.
(Use QUIT to end a nested batch file and return to the
previous batch file.)
You can CANCEL at any point in a batch file.
See also CALL and QUIT.
Example: The following batch file fragment compares an input
line to "end" and terminates all batch file processing
if it matches:
input Enter your choice: %%option
if "%option" == "end" cancel
4DOS Reference Manual 36
CD / CHDIR CD / CHDIR
Syntax: CD [d:][pathname] CD [d:][pathname]
or
CHDIR [d:][pathname] CHDIR [d:][pathname]
Purpose: Display or change the current directory.
Comments: Entering CD with no argument or only a disk drive
name will display the current directory. Entering CD
and a pathname will change the current directory.
Every disk drive on the system has its own current
directory. Specifying both a drive and a directory in
the CD command will change the current directory on the
specified drive, but will not change the default drive.
Use CDD to change both the drive and directory.
To start at the root directory, start the pathname
with a backslash (\). To start at the parent
directory, start the pathname with two periods (..).
All other pathnames start at the current directory.
MS-DOS will not accept directory names longer than
64 characters.
See also CDD.
Example: Change to the subdirectory C:\FINANCE\MYFILES: __________________
c:\> cd \finance\myfiles cd \finance\myfiles
c:\finance\myfiles>
Change the default directory on drive A:
c:\> cd a:\utility cd a:\utility
4DOS Reference Manual 37
CDD CDD
Syntax: CDD [d:]pathname CDD [d:]pathname
Purpose: Change the current disk drive and directory.
Comments: CDD is similar to CD, except it can also change the
default disk drive.
See also CD.
Example: Change from the root directory on drive A to the
subdirectory C:\WP: _____
a:\> cdd c:\wp cdd c:\wp
c:\wp>
4DOS Reference Manual 38
CHCP CHCP
Syntax: CHCP [n] CHCP [n]
Purpose: Display or change the current system code page.
Comments: Code page switching allows you to select different
character sets for language support. To use code page
switching, you must have an EGA or VGA board, and MS-
DOS 3.3 or above.
Before using CHCP, you must load the device drivers
(in CONFIG.SYS); make sure the information file
(COUNTRY.SYS) is available; load national language
support (using the NLSFUNC command); and prepare the
specified code page for the devices (using the MODE
command with the CODEPAGE PREPARE option).
CHCP accepts one of the two prepared system code
pages. An error message is displayed if a code page is
selected that has not been prepared for the system.
Entering CHCP with no arguments displays the active
code page.
See your MS-DOS manual for more information on CHCP.
Example: Display the current code page:
c:\> chcp chcp
Active code page: 437
Set the code page to multilingual:
c:\> chcp 850 chcp 850
4DOS Reference Manual 39
CLS CLS
Syntax: CLS CLS
Purpose: Clear the video display.
Comments: CLS clears the display and moves the cursor to the
upper left corner.
CLS is normally used in batch files to clear the
screen before displaying text (see ECHO, SCREEN, and
TEXT).
CLS uses the Clear Screen command in ANSI. You must
have an ANSI driver defined in your CONFIG.SYS file for
CLS to work (see INSTALLATION).
Example: Clear the display:
c:\> cls cls
4DOS Reference Manual 40
COPY COPY
Syntax: COPY [/PV] [d:][path]filename[+]... [[d:][path]filename] COPY [/PV] [d:][path]filename[+]... [[d:][path]filename]
Purpose: Copy or append one or more files.
Comments: Unlike COMMAND.COM, 4DOS allows you to copy several
unrelated files to a target directory with a single
COPY command. If there are two or more arguments on
the command line, COPY assumes the last argument is the
target. If there is only one argument, the target is
assumed to be the current directory.
The /P(rompt) option prompts you to confirm each
file copy (Y or N). An N response will skip that
particular file.
The /V(erify) option verifies each disk write. This
is the same as executing the VERIFY ON command, but is
only active during the COPY command.
The plus (+) tells 4DOS to append two or more files +
to a single target file. If you don't specify a
target, COPY will append each subsequent file to the
first file.
If you specify more than one source file, and the
target is NOT a directory, COPY will automatically
append the files to the target.
You cannot copy a file to itself.
COPY in 4DOS does not support the /A and /B options
of COPY in COMMAND.COM.
Example: Copy the files MEMO1, PROJECT8.WKS, and UPDATE.BAT _____ ____________ __________
to the root directory on drive A:
c:\> copy memo1 project8.wks update.bat a:\ copy memo1 project8.wks update.bat a:\
Append the files MEMO1, MEMO2, and MEMO3, and store _____ _____ _____
the result in BIGMEMO: _______
c:\> copy memo1+memo2+memo3 bigmemo copy memo1+memo2+memo3 bigmemo
4DOS Reference Manual 41
DATE DATE
Syntax: DATE [mm-dd-yy] DATE [mm-dd-yy]
Purpose: Display and (optionally) change the system date.
Comments: If you don't enter any parameters, DATE will display
the current system date and time, and prompt for the
new date. Press ENTER if you don't wish to change the
date, otherwise enter the new date.
The parameters for the DATE command are:
mm (month) = 1 - 12 __
dd (day) = 1 - 31 __
yy (year) = 80 - 199 (1980 - 2099) __
You can use hyphens, slashes, or periods to separate
the month, day, and year entries.
The format for the date entry depends on the country
code defined in the CONFIG.SYS file or by the CHCP
command. The default format is U.S. (mm-dd-yy). The
European format is dd-mm-yy; the Japanese is yy-mm-dd.
See also TIME.
Example: Enter the date from the command line:
c:\> date 12/25/89 date 12/25/89
To be prompted for the date:
c:\> date date
Mon Dec 25, 1989 9:30:06
Enter new date (mm-dd-yy):
4DOS Reference Manual 42
DEL / ERASE DEL / ERASE
Syntax: DEL [/P] [d:][path]filename... DEL [/P] [d:][path]filename...
or
ERASE [/P] [d:][path]filename... ERASE [/P] [d:][path]filename...
Purpose: Erase the specified file(s) from the disk.
Comments: If the /P(rompt) option is specified, 4DOS will
prompt you to enter a Y or N to confirm each file
deletion.
If you enter a subdirectory name, or a filename
composed only of wildcards (* and ?), DEL asks for
confirmation (Y or N). If you respond with a Y, DEL
will delete all the files in that subdirectory (except
hidden and read-only files).
Example: Erase all the files in the current directory with a
.BAK or .PRN extension: ____ ____
c:\> del *.bak *.prn del *.bak *.prn
Confirm the deletion of all the files in the current
directory with a .WKS extension: ____
c:\> del /P *.wks del /P *.wks
Delete JAN88.WKS (Y/N)? n
Delete FEB87.WKS (Y/N)? y
Delete DEC87.WKS (Y/N)? y
4DOS Reference Manual 43
DESCRIBE DESCRIBE
Syntax: DESCRIBE [d:][path]filename... DESCRIBE [d:][path]filename...
Purpose: Create, modify, or delete file descriptions.
Comments: DESCRIBE adds descriptions (up to 40 characters) to
MS-DOS filenames. The descriptions will be displayed
when using DIR with the default single column option,
or when using SELECT.
File descriptions allow you to identify your files
in much more meaningful ways than MS-DOS allows in an
eight character filename.
Descriptions are stored in each directory in a
hidden file called DESCRIPT.ION. Use the ATTRIB
command to "unhide" this file if you need to copy or
delete it.
Descriptions are not copied when you do a COPY,
MOVE, or RENAME.
Example: Create a description for the file MEMO.TXT: ________
c:\> describe memo.txt describe memo.txt
Describe "memo.txt" : Memo to Bob about party Memo to Bob about party
4DOS Reference Manual 44
DIR DIR
Syntax: DIR [/[12ADFHJPQSWX] [Oetzur]] [[d:][path]filename...] DIR [/[12ADFHJPQSWX] [Oetzur]] [[d:][path]filename...]
Purpose: Display information about files and subdirectories.
Comments: DIR displays information about the files and
subdirectories in the specified directory. Depending
upon the options specified, DIR can show the filename,
file attributes, size, date and time of the most recent
change to the file, and the file description.
DIR allows wildcard characters (* and ?) in the
filename. If you don't specify a filename, DIR
defaults to *.* (display all files and subdirectories
in the current directory).
If a country code was defined in the CONFIG.SYS file
or by the CHCP command, DIR will display the date in
the format for that country. The default date format
is U.S. (mm-dd-yy).
The DIR options are:
1 Single column display - display the filename, 1
size, date, time, and description. This is the
default.
2 Two column display - display the filename, size, 2
date, and time.
A Display the filenames and attributes only (see A
ATTRIB), in the format RHSA, where:
R read-only R
H hidden H
S system S
A archive A
D Display the contents of the current directory and D
all of its subdirectories.
F Display files only (no subdirectories). F
H Display all files, including hidden and system H
files.
J Justify the output (same output as COMMAND.COM) J
4DOS Reference Manual 45
O? Sort sequence, where ? can be any combination of O?
the following options:
e sort by extension e
t sort by time, oldest first t
z sort by size z
u unsorted (same as COMMAND.COM) u
r reverse the normal sort order r
The default sort is by filename.
P Pause after each screen page and wait for a key P
to be pressed (useful for displaying long
directory listings).
Q Suppress the header line and summaries, and Q
display file or subdirectory names only, in a
single column (useful when redirecting output
to another program).
S Display summary only (number of files & bytes S
used).
W Wide display - display the filenames only, W
horizontally across the screen.
X Display directories only. X
See also DESCRIBE.
Example: Display the .WKS files, and then the .PRN files in ____ ____
the current directory:
c:\> dir *.wks *.prn dir *.wks *.prn
Display the files in the current directory, sorted
by time (most recent first):
c:\> dir /otr *.* dir /otr *.*
Display all the files on drive C, including hidden
and system files, pausing after each page:
c:\> dir /dhp c:\*.* dir /dhp c:\*.*
4DOS Reference Manual 46
DIRS DIRS
Syntax: DIRS DIRS
Purpose: Display the current directory stack.
Comments: DIRS displays the directory stack used by PUSHD and
POPD (most recent entries first). The directory stack
holds up to 255 characters (about 10 to 20 entries).
See also PUSHD and POPD.
Example: Change directories and then display the directory
stack:
c:\> pushd c:\database pushd c:\database
c:\database> pushd d:\wordp\memos pushd d:\wordp\memos
d:\wordp\memos> dirs dirs
c:\database
c:\
4DOS Reference Manual 47
ECHO ECHO
Syntax: ECHO [on | off | message] ECHO [on | off | message]
Purpose: Display the echo status, enable or disable batch
file or command line echoing, or display a message.
Comments: 4DOS defaults to ECHO ON in batch files. To prevent
a line from being echoed, preface it with the @ symbol.
You can tell 4DOS to default to ECHO OFF by setting the
variable VERBOSE to 0 (see SETDOS).
4DOS defaults to ECHO OFF during keyboard input. If
you set ECHO ON from the command line, 4DOS will
display the fully parsed and expanded commands
(including aliases and variables) before they are
executed.
If no arguments are entered, ECHO displays the
current echo status (ON or OFF).
ECHO commands in a batch file will send messages to
the screen while the batch file executes, even if ECHO
is set OFF. You cannot use the command separator
character or the 4DOS redirection symbols (|, >, or <)
in an ECHO message, unless you enclose them in quotes
or precede them with the escape character.
See also SCREEN, SETDOS, and TEXT.
Example: Enable command line echoing:
c:\> echo on echo on
Display a message in a batch file:
echo Processing your print files...
Turn off batch file echoing, without displaying the
ECHO command itself:
@echo off
4DOS Reference Manual 48
ENDLOCAL ENDLOCAL
Syntax: ENDLOCAL ENDLOCAL
Purpose: Restore the saved disk drive, directory, and
environment.
Comment: ENDLOCAL restores the disk drive, directory, and
environment saved by the previous SETLOCAL command.
SETLOCAL and ENDLOCAL can only be used in batch files.
See also SETLOCAL.
Example: This batch file fragment saves the environment,
drive, and current working directory, changes the drive
and directory, modifies some environment variables,
runs a program, and then restores the original values:
setlocal
cdd d:\test
set path=c:\;c:\dos;c:\util
set lib=d:\lib
rem run some program here
endlocal
4DOS Reference Manual 49
ESET ESET
Syntax: ESET varname... ESET varname...
Purpose: Edit environment variables and/or aliases.
Comments: ESET allows you to edit your environment variables
and aliases using the 4DOS line editing commands (see
the Command Line Editing section in USING 4DOS). The
cursor will be positioned at the first character of the
variable or alias.
ESET will search for environment variables first,
and then aliases.
4DOS limits environment variable and alias names to
80 characters, and their arguments to 255 characters.
See also ALIAS and SET.
Example: Edit the default MS-DOS executable file search path:
c:\> eset path eset path
path=c:\;c:\dos;c:\util _
Create and then edit an alias:
c:\> alias d dir /djp alias d dir /djp
c:\> eset d eset d
d=dir /djp _
4DOS Reference Manual 50
EXCEPT EXCEPT
Syntax: EXCEPT ([d:][path]filename...) command [args...] EXCEPT ([d:][path]filename...) command [args...]
Purpose: Perform a command, except on the file(s) specified.
Comments: EXCEPT provides a means of executing a command on a
group of files and/or subdirectories, except those
enclosed within the parentheses.
You may use the MS-DOS wildcard characters (? and *)
in a filename.
EXCEPT prevents operations on the specified file(s)
by setting the hidden attribute, performing the
command, and then clearing the hidden attribute. If
EXCEPT is aborted in an unusual way, you may need to
use the ATTRIB command to "unhide" (-H) the file(s).
EXCEPT will not work with programs or commands that
ignore the hidden attribute.
See also ATTRIB.
Example: Erase all but the files beginning with MEMO and ____
those ending in .WKS: ____
c:\> except (memo*.* *.wks) erase *.* except (memo*.* *.wks) erase *.*
Copy all the files and subdirectories except those
in C:\MSC and C:\DOS on drive C to drive D: ______ ______
c:\> except (c:\msc c:\dos) xcopy c:\*.* d:\ /s except (c:\msc c:\dos) xcopy c:\*.* d:\ /s
4DOS Reference Manual 51
EXIT EXIT
Syntax: EXIT EXIT
Purpose: Return from a secondary command processor.
Comments: Some application programs will start a secondary
copy of the command processor to allow you to execute
MS-DOS commands. To return to the application again,
type EXIT.
You cannot EXIT from the primary command processor.
4DOS Reference Manual 52
FOR FOR
Syntax: FOR %%var IN (set) DO command ... Syntax: FOR %%var IN (set) DO command ...
Purpose: Repeat a command for several variables.
Comments: 4DOS sets var sequentially to each member of (set), ___ _____
and then evaluates and executes command for every _______
argument in (set). If one of the arguments in (set) _____ _____
contains MS-DOS wildcard characters (* and ?), var will ___
be set sequentially to each matching filename on the
disk.
You must use two percent signs (%%) before the
variable name to prevent 4DOS from expanding the
variable on the command line before it is passed to
FOR.
Example: The following example compiles the C programs in the
current directory that have a "2" or a "3" somewhere in
their name:
c:\msc> for %%a in (*2*.c *3*.c) do cl %%a for %%a in (*2*.c *3*.c) do cl %%a
4DOS Reference Manual 53
FREE FREE
Syntax: FREE [d:]... FREE [d:]...
Purpose: Display the total and free disk space on the
specified (or default) drive(s).
Comments: FREE provides the same disk information as CHKDSK,
but without the wait.
See also MEMORY.
Example: Display the status of the current drive:
c:\> free
Volume in drive C: is DEVELOPMENT
30,203,904 bytes total disk space
14,331,904 bytes free
Display the status of drives A, B, and C:
c:\> free a: b: c:
Volume in drive A: is unlabeled
1,213,952 bytes total disk space
487,424 bytes free
Volume in drive B: is WORKSHEETS
362,496 bytes total disk space
237,568 bytes free
Volume in drive C: is DEVELOPMENT
30,203,904 bytes total disk space
14,331,904 bytes free
4DOS Reference Manual 54
GLOBAL GLOBAL
Syntax: GLOBAL command [args] GLOBAL command [args]
Purpose: Execute a command in the current directory and its
subdirectories.
Comments: GLOBAL performs the command first in the current
directory, and then in each of its subdirectories.
The command cannot be an alias.
GLOBAL will terminate if the command returns a non-
zero exit code.
Example: Erase all the files with a .BAK extension in every ____
directory on C:
c:\> global erase c:\*.bak global erase c:\*.bak
Copy the files in every directory on drive A to the
directory C:\TEMP : _______
a:\> global copy *.* c:\temp global copy *.* c:\temp
4DOS Reference Manual 55
GOSUB GOSUB
Syntax: GOSUB label GOSUB label
Purpose: Call a subroutine in a batch file.
Comments: GOSUB calls the specified label as a subroutine.
The subroutine must end with a RETURN statement. After
the RETURN, 4DOS will continue processing on the line
following the GOSUB.
If you don't enter a label, or the label doesn't
exist, the batch file is terminated with the error
message "Label not found."
The line with the label must begin with a colon (:).
4DOS ignores case differences when matching labels.
GOSUBS may be nested up to 5 levels deep.
See also GOTO and RETURN.
Example: The following batch file fragment calls a subroutine
which displays the directory and returns:
echo Calling a subroutine
gosub subr1
echo Returned from the subroutine
quit
:subr1
dir /hw
return
4DOS Reference Manual 56
GOTO GOTO
Syntax: GOTO label GOTO label
Purpose: Continue batch file processing at the line following
the label.
Comments: GOTO jumps to the line immediately following the
label. If you don't enter a label, or the label
doesn't exist, the batch file is terminated with the
error message "Label not found."
The line with the label must begin with a colon (:).
4DOS ignores case differences when matching labels.
See also GOSUB.
Example: The following batch file fragment checks for the
existence of the file CONFIG.SYS. If the file exists,
4DOS jumps to C_EXISTS and copies all the files from
the current directory to the root directory on A. If
CONFIG.SYS doesn't exist, 4DOS prints an error message
and exits.
if exist config.sys goto C_EXISTS
echo CONFIG.SYS doesn't exist - exiting.
quit
:C_EXISTS
copy *.* a:\
4DOS Reference Manual 57
HELP HELP
Syntax: HELP [topic] HELP [topic]
Purpose: Provide help for 4DOS and MS-DOS commands.
Comments: The HELP command displays the proper syntax and a
brief description of 4DOS and MS-DOS commands. You can
also call HELP by pressing F1 at the command line.
If you enter HELP with no topic, HELP will display
all the commands it can help you with. Select a topic
using the cursor keys and press ENTER.
For help on a specific command, enter HELP followed
by the command name.
DOS.HLP must be in the current directory or one of
the directories specified in the PATH environment
variable.
HELP is an external command.
Example: Display and select from all the available help
topics:
c:\> help help
For help on COPY:
c:\> help copy help copy
4DOS Reference Manual 58
HISTORY HISTORY
Syntax: HISTORY [/F] HISTORY [/F]
Purpose: Display or clear the history list.
Comments: If no parameters are entered, HISTORY will display
the current history list.
The /F(ree) option clears the command history list.
The number of commands saved in the history list
depends on the length of each command line. The
history list size can be specified at startup from 512
to 8192 characters (see INSTALLATION). The default
size is 1024 characters.
You can disable saving commands to the history list,
or specify a minimum command line length to save, with
the SETDOS /H command.
See also SETDOS.
Example: Display the history list:
c:\> history history
Clear the history entries:
c:\> history /f history /f
4DOS Reference Manual 59
IF IF
Syntax: IF [NOT] condition command IF [NOT] condition command
Purpose: Allow conditional execution of commands.
Comments: 4DOS first tests the given condition. If the
condition is true, 4DOS executes the specified command,
otherwise the command will be ignored. If you use the
NOT option, the command is executed only when the
condition is false.
For the string tests, case differences are ignored.
The condition can be any of the following:
string1 == string2 ==
string1 EQ string2 EQ
If string1 is equal to string2, the condition _______ _______
is true.
string1 NE string2 NE
If string1 is not equal to string2, the _______ _______
condition is true.
string1 LT string2 LT
If string1 is < string2, the condition is true. _______ _______
string1 LE string2 LE
If string1 is <= string2, the condition is _______ _______
true.
string1 GE string2 GE
If string1 is >= string2, the condition is _______ _______
true.
string1 GT string2 GT
If string1 is > string2, the condition is true. _______ _______
ERRORLEVEL n ERRORLEVEL
If the preceding program returns an exit code
greater than or equal to n, the condition is true. _
NOTE: Not all programs return an explicit exit
code. In those cases, the behavior of ERRORLEVEL
is undefined.
4DOS Reference Manual 60
EXIST [d:][path]filename EXIST
If the file exists, the condition is true. You
can use wildcard characters (* and ?) in the
filename.
ISDIR [d:]path ISDIR
If the subdirectory exists, the condition is
true.
Example: Test for the presence of A:\JAN.DOC, and copy it to __________
the root directory on drive C if it exists:
c:\> if exist a:\jan.doc copy a:\jan.doc c:\ if exist a:\jan.doc copy a:\jan.doc c:\
This batch file fragment tests for a string value:
input "Enter your selection : " %%cmd
if "%cmd" == "WP" goto wordproc
if "%cmd" NE "GRAPHICS" goto badentry
4DOS Reference Manual 61
INKEY INKEY
Syntax: INKEY [text] %%varname INKEY [text] %%varname
Purpose: Enter a single keystroke environment variable from
the standard input.
Comments: You can optionally display some prompt text before
the variable name.
ASCII values from 1 to 255 are stored as a character.
Extended characters (for example, function keys and
cursor keys) are stored as a string in decimal format,
with a leading @ (for example, the F1 key is stored as
@59). This is the same format used by the KEYSTACK
command.
INKEY and INPUT are normally used as batch file
commands, allowing you great flexibility in entering or
changing batch variables.
See Appendix C for a list of the extended key codes.
See also INPUT.
Example: The following batch file fragment prompts for a
character and stores it in the variable NUM: ___
inkey Enter a number from 1 to 9: %%num
4DOS Reference Manual 62
INPUT INPUT
Syntax: INPUT [text] %%varname INPUT [text] %%varname
Purpose: Enter an environment variable from the standard
input.
Comments: You can optionally display some prompt text before
the variable name.
All characters entered up to, but not including, the
carriage return are stored in the variable.
INPUT and INKEY are normally used as batch file
commands, allowing you great flexibility in entering
or changing batch variables.
See also INKEY.
Example: The following batch file fragment prompts for a
string and stores it in the variable FNAME: _____
input Enter the file name: %%fname
4DOS Reference Manual 63
KEYSTACK KEYSTACK
Syntax: KEYSTACK ["abc"] [nn] [@nn] KEYSTACK ["abc"] [nn] [@nn]
Purpose: Feed keystrokes to a program from a batch file or
alias.
Comments: Characters entered within double quotes ("abc") will
be stored "as is" in the keyboard buffer. Numbers (nn) __
not enclosed in quotes are ASCII decimal codes (e.g.,
13 (ENTER), or 27 (ESCAPE)). The number 0 is a special
case; it is used with programs that flush the keyboard
buffer (it tells the program the buffer is clear, so
subsequent keystrokes will be accepted normally).
Numbers preceded by @ are extended keyboard codes
generated by the Alt key, cursor pad keys, and the
Function keys (e.g., @59 is the F1 function key). See
Appendix C for a list of the extended key codes.
You can store a maximum of 255 characters.
Each time KEYSTACK is executed, it will clear any
remaining keystrokes stored by a previous KEYSTACK.
You may need to experiment a bit with your programs
to find the proper sequence of keystrokes. Programs
that bypass MS-DOS and the BIOS for keyboard input will
not work with KEYSTACK.
KEYSTACK requires the device driver KEYSTACK.SYS be
loaded in the CONFIG.SYS file (see INSTALLATION).
Example: The following batch file starts Lotus 1-2-3 and
loads the file specified on the command line:
pushd c:\123
keystack 0 13 0 13 0 13 0 13 0 13 "/FR" 0 "%1" 13
123
popd
The same command defined as an alias (enter this on
one line):
alias 321 `pushd c:\123 ^ keystack 0 13 0 13 0 13
0 13 0 13 "/FR" 0 "%1" 13 ^ 123 ^ popd`
4DOS Reference Manual 64
LIST LIST
Syntax: LIST [d:][path]filename... LIST [d:][path]filename...
Purpose: Display a file with forward and backward paging and
scrolling.
Comments: LIST provides a much faster and more flexible way to
view a file than TYPE, without the overhead of using a
text editor. LIST can handle any size file.
The PgUp key moves you back one page; the PgDn key
moves you forward one page. The Home key displays the
first page of the file, the End key the last page. The
up arrow scrolls back one line, the down arrow forward
one line. The left arrow key moves the display left 8
characters at a time, and the right arrow key moves the
display right 8 characters at a time.
The F1 key will search for a text string; the F2 key
will find the next matching text string (case
differences are ignored).
The Esc key will exit the current file; the ^C or
^BREAK keys will exit LIST.
LIST is normally only useful for displaying ASCII
text files; executable files (.COM and .EXE) and many
data files will be unreadable due to the presence of
non-alphanumeric characters.
See also TYPE.
Example: Display the file MEMO.DOC: ________
c:\> list memo.doc list memo.doc
4DOS Reference Manual 65
MD / MKDIR MD / MKDIR
Syntax: MD [d:]pathname... MD [d:]pathname...
or
MKDIR [d:]pathname... MKDIR [d:]pathname...
Purpose: Create subdirectories.
Comments: To start at the root directory, start the pathname
with a backslash (\). To start at the parent
directory, start the pathname with two periods (..).
All other pathnames start at the current directory.
The longest allowable path in MS-DOS from the root
directory to any subdirectory is 64 characters
(including backslashes).
See also RD.
Example: Create a subdirectory called MYDIR in the root _____
directory:
c:\> md \mydir md \mydir
Create a subdirectory called DIRTWO in the current ______
directory:
c:\mydir> md dirtwo md dirtwo
4DOS Reference Manual 66
MEMORY MEMORY
Syntax: MEMORY MEMORY
Purpose: Display the system RAM status.
Comments: MEMORY displays the total RAM, the free RAM
(available to applications programs after loading MS-
DOS, device drivers, 4DOS itself, and RAM resident
programs); the total and free expanded memory, extended
memory (for 80286 and 80386 machines); and the total
and free environment space.
Example: Display your RAM totals:
c:\> memory
655,360 bytes total RAM
534,464 bytes free
524,288 bytes total EXPANDED memory
524,288 bytes free
2,097,152 bytes total EXTENDED memory
1,024 bytes total ENVIRONMENT
763 bytes free
4DOS Reference Manual 67
MOVE MOVE
Syntax: MOVE [/P] [d:][path]filename... [d:][path]filename MOVE [/P] [d:][path]filename... [d:][path]filename
Purpose: Move files to other directories and drives.
Comments: The MOVE command moves the specified file(s) to the
last filename specified, which is designated as the
target. If the target already exists, it is deleted
when the file is moved. You cannot move a file to
itself.
If there is more than one source file specification,
the target must be a directory, and the files are moved
to the directory with their original filenames. If the
target is not a directory, MOVE will display an error
message and exit.
The /P(rompt) option will prompt you for a Y or N
response to confirm each move.
MOVE first attempts to rename the file(s). If that
fails (the target is on a different drive, or the
target already exists), MOVE will copy the file(s) and
then delete the originals.
See also COPY and RENAME.
Example: Move some files to a different directory:
c:\> move *.wks *.txt c:\finance\myfiles move *.wks *.txt c:\finance\myfiles
4DOS Reference Manual 68
PATH PATH
Syntax: PATH [[d:]path;[d:]path...]] PATH [[d:]path;[d:]path...]]
Purpose: Tells 4DOS where to search for executable and batch
files not in the current directory.
Comments: When searching for an external command (.COM, .EXE,
and .BAT), 4DOS searches the current directory first,
then the directories you specify in the order you list
them. The directory names are separated by semicolons
(;).
If you enter PATH with no parameters, 4DOS displays
the current search path. If you enter PATH and a
semicolon, 4DOS clears the search path and will search
only the current directory (this is the default at
system startup).
If you specify an invalid directory, 4DOS will skip
that directory and continue searching with the next
directory in the path.
Some applications use the PATH variable to search
for their files.
You can edit the path with the ESET command.
Example: The following PATH command directs 4DOS to search
for an executable file in the following order: the
current directory, the root directory on C, the DOS
subdirectory on C, and the UTIL subdirectory on C:
c:\> path c:\;c:\dos;c:\util path c:\;c:\dos;c:\util
Display the current search path:
c:\> path path
c:\;c:\dos;c:\util
4DOS Reference Manual 69
PAUSE PAUSE
Syntax: PAUSE [message] PAUSE [message]
Purpose: Suspend alias or batch file execution.
Comments: A PAUSE command in a batch file will suspend
execution, giving you the opportunity to perform
activities such as changing disks, turning on the
printer, etc.
PAUSE waits for any key (except ^C or ^BREAK) to be
pressed and then continues executing the batch file.
If a prompt message is specified, 4DOS will display the
message and wait for a keystroke. Otherwise, 4DOS will
prompt:
Strike a key when ready... Strike a key when ready...
If you press ^C or ^BREAK while executing a batch
file, 4DOS will prompt:
Cancel batch job (Y/N)? Cancel batch job (Y/N)?
This gives you a way to quit a batch file at an
intermediate point. If you are nesting batch files
(see CALL), a Y response will return you to the calling
batch file.
Example: The following batch file fragment prompts the user
before erasing files:
pause ^C aborts, any other key erases the .LST files
erase *.lst
4DOS Reference Manual 70
POPD POPD
Syntax: POPD [*] POPD [*]
Purpose: Change to the disk drive and directory at the top of
the directory stack.
Comments: POPD restores the disk drive and directory saved
using PUSHD (most recent first).
The * option clears the directory stack, without
changing the current drive and directory.
Use the DIRS command to display the directory stack.
See also DIRS and PUSHD.
Example: Save and change your disk drive and directory with
PUSHD, and then restore it:
c:\> pushd d:\database\test pushd d:\database\test
d:\database\test> pushd c:\wordp\memos pushd c:\wordp\memos
c:\wordp\memos> pushd a:\123 pushd a:\123
a:\123> popd popd
c:\wordp\memos> popd popd
d:\database\test> popd popd
c:\>
Clear the directory stack:
c:\> popd * popd *
4DOS Reference Manual 71
PROMPT PROMPT
Syntax: PROMPT [text] PROMPT [text]
Purpose: Change the 4DOS command line prompt.
Comments: If you enter PROMPT with no arguments, 4DOS sets the
prompt to $p$g (display current disk and directory).
The prompt text can contain special strings of the
form $?, where ? is one of the following:
a The & character
b The | character
c The open parenthesis (
d Current date, in the format Sun Jan 1, 1989
e The ASCII ESC character (decimal 27)
f The close parenthesis )
g The > character
h BACKSPACE over the previous character
l The < character
n Default drive letter
p Current disk and directory
q The = character
s The space character
t Current time, in the format hh:mm:ss
v MS-DOS version number, in the format 3.10
_ CR/LF (go to beginning of new line)
$ The $ character
Example: Set the prompt to the current date and time:
c:\> prompt $d $t $g prompt $d $t $g
Mon Dec 25, 1989 18:29:19 >
Set the prompt using ANSI escape sequences (see
Appendix B) to display the date, time, and path on the
top line (this should be entered on one line):
c:\> prompt $e[s$e[1;1f$e[37;1;41m$e[K $d $sTime: prompt $e[s$e[1;1f$e[37;1;41m$e[K $d $sTime:
$t$h$h$h $sPath: $p$e[u$e[0;32m$n$g $t$h$h$h $sPath: $p$e[u$e[0;32m$n$g
4DOS Reference Manual 72
PUSHD PUSHD
Syntax: PUSHD [d:]pathname PUSHD [d:]pathname
Purpose: Save the current disk drive and directory.
Comments: PUSHD saves the current directory on the directory
stack, and changes the disk drive and directory. The
directory stack can hold up to 255 characters (about 10
to 20 entries).
The saved directory is restored on a "last in, first
out" basis by the POPD command. The directory stack
can be displayed with the DIRS command.
See also DIRS and POPD.
Example: Save the current directory and change to
C:\WORDP\MEMOS: ______________
c:\> pushd \wordp\memos pushd \wordp\memos
c:\wordp\memos>
4DOS Reference Manual 73
QUIT QUIT
Syntax: QUIT QUIT
Purpose: Terminate the current batch file.
Comments: You can QUIT at any point in a batch file, not just
at the end.
If you QUIT a batch file called from another batch
file, you will be returned to the previous file at the
line following the original call. To end all batch
file processing, use CANCEL.
See also CANCEL.
Example: This batch file fragment checks to see if the user
entered "quit" and exits if true. Otherwise, it calls
two subroutines and then exits.
input Enter your choice : %%option
if "%option" == "quit" quit
rem Perform the option processing
gosub firstroutine
gosub secondroutine
quit
4DOS Reference Manual 74
RD / RMDIR RD / RMDIR
Syntax: RD [d:]path... RD [d:]path...
or
RMDIR [d:]path... RMDIR [d:]path...
Purpose: Remove one or more subdirectories.
Comments: Before removing a subdirectory, you must delete all
the files and subdirectories (and their files) in that
directory (including any hidden or read-only files).
You can use the MS-DOS wildcard characters (* and ?)
in the directory names.
You cannot remove the root directory (\), the
current directory (.), or the parent directory (..).
See also MD.
Example: Remove the subdirectory MEMOS from the subdirectory _____
WP: __
c:\> rmdir \wp\memos rmdir \wp\memos
4DOS Reference Manual 75
REM REM
Syntax: REM [comment] REM [comment]
Purpose: Put a comment in a batch file.
Comments: If ECHO is ON, or the variable VERBOSE (see the
SETDOS command) is set, 4DOS will echo the comment.
Otherwise, 4DOS will ignore it. If you don't want to
echo the line, preface REM with the @ character.
Enter your comment following the REM, separated by a
space or tab. Comments can be up to 255 characters.
4DOS will ignore everything following a REM, including
the redirection symbols (>, <, and |) and the command
separator character.
Batch file comments are useful for documenting the
purpose for a batch file and the procedures used.
Example: Enter comments in a batch file:
rem This batch file provides a
rem menu-based system for accessing
rem the word processing utilities.
rem Clear the screen and get selection
cls
4DOS Reference Manual 76
REN / RENAME REN / RENAME
Syntax: REN [/P] [d:][path]filename... [d:][path]filename REN [/P] [d:][path]filename... [d:][path]filename
or
RENAME [/P] [d:][path]filename... [d:][path]filename RENAME [/P] [d:][path]filename... [d:][path]filename
Purpose: Rename files or directories.
Comments: The last filename is the new name; the preceding
names are the files or directories to be renamed. You
can use the wildcard characters (? and *) in the
filenames. The new filename must not already exist.
If the /P(rompt) option is specified, 4DOS will
prompt you to enter Y or N to confirm each rename.
4DOS allows you to rename files to a new directory
on the same disk drive. If you want to rename to a
different drive, use the MOVE command.
NOTE: You cannot rename a subdirectory to a new
path!
See also MOVE.
Example: Rename the file MEMO.TXT to OFFICE.TXT: ________ __________
c:\> rename memo.txt office.txt rename memo.txt office.txt
Rename the file MEMO.TXT to another directory: ________
c:\> rename memo.txt c:\wp\memos\memo.txt rename memo.txt c:\wp\memos\memo.txt
Rename the directory \WORDPROC to \WP: _________ ___
c:\> rename \wordproc \wp rename \wordproc \wp
Rename two files to another directory:
c:\> rename f12.wks f37.wks c:\wks\ffiles rename f12.wks f37.wks c:\wks\ffiles
4DOS Reference Manual 77
RETURN RETURN
Syntax: RETURN RETURN
Purpose: Return from a GOSUB (subroutine) call in a batch
file.
Comments: The RETURN command returns from a GOSUB call to the
line following the original GOSUB.
See also GOSUB.
Example: The following batch file fragment calls a subroutine
which displays the current directory:
echo Calling a subroutine
gosub subr1
echo Returned from the subroutine
quit
:subr1
dir /hw
return
4DOS Reference Manual 78
SCREEN SCREEN
Syntax: SCREEN row column [message] SCREEN row column [message]
Purpose: Position the cursor on the screen, and optionally
display a message.
Comments: SCREEN allows you to create attractive batch file
screen displays.
See also ECHO and TEXT.
Example: The following batch file fragment displays a menu:
@echo off
cls
screen 3 10 Select a number from 1 to 4:
screen 6 20 1 - Word Processing
screen 7 20 2 - Spreadsheet
screen 8 20 3 - Telecommunications
screen 9 20 4 - Quit
4DOS Reference Manual 79
SELECT SELECT
Syntax: SELECT [/Oertuz] command ([d:][path]filename...)... SELECT [/Oertuz] command ([d:][path]filename...)...
Purpose: Execute a command on the specified files.
Comments: SELECT allows you to select command line file
arguments by marking the directory entries using a
full-screen "point-and-shoot" display. SELECT
substitutes the selected files for the argument
enclosed in parentheses, and executes the command for
each marked file. If you specify multiple arguments in
the parentheses, SELECT will display the matching files
for the first argument, prompt you to mark the files,
execute the command for each marked file, and then
continue the same procedure with the next argument.
SELECT uses the up arrow, down arrow, PgUp, and PgDn
keys to scroll through the files matching the
argument(s). Use the + key to select a file, and the -
key to unselect a file. The * key will select all of
the files (excluding subdirectories). After marking
the files, press ENTER to execute the command.
You can select a single file by moving the scroll
bar to the filename and pressing ENTER.
To cancel the SELECT command, type an Escape, ^C, or
^BREAK.
The /O option determines the sort order for the
directory display (the default sort is by filename):
e sort by extension e
t sort by time (oldest first) t
z sort by size z
u unsorted u
r reverse the sort order r
Example: Select from the files in the current directory with
the extension .COM, and then from the files with the ____
extension .EXE to copy to the root directory on drive ____
A:
c:\> select copy (*.com *.exe) a:\ select copy (*.com *.exe) a:\
4DOS Reference Manual 80
SET SET
Syntax: SET [variable[=][value]] SET [variable[=][value]]
Purpose: Display, create, modify, or delete environment
variables.
Comments: Entering SET with no variable or value displays the ________ _____
environment. If you don't enter a value, SET will _____
remove the variable from the environment. Otherwise, ________
the variable and the value are placed in the ________ _____
environment. If the variable already exists, its old ________
contents are replaced by the new value. 4DOS limits _____
the variable name to a maximum of 80 characters, and ________
the value to a maximum of 255 characters. _____
SET only affects the environment of the current
command processor. If you EXIT to a parent command
processor, the original environment will be unchanged.
The size of the environment is specified by the /E
parameter at startup. The default size is 1024
characters.
You can edit environment variables with the ESET
command.
See also ESET.
Example: Display the current environment:
c:\> set set
COMSPEC=C:\4DOS.COM
PATH=c:\;c:\dos;c:\util
Add a variable to the environment:
c:\> set mine=c:\finance\myfiles set mine=c:\finance\myfiles
c:\> set set
COMSPEC=C:\4DOS.COM
PATH=c:\;c:\dos;c:\util
MINE=c:\finance\myfiles
Remove a variable from the environment:
c:\> set mine set mine
4DOS Reference Manual 81
SETDOS SETDOS
Syntax: SETDOS [/C? /E? /H? /M? /N? /V?] SETDOS [/C? /E? /H? /M? /N? /V?]
Purpose: Display or set 4DOS configuration variables.
Comments: SETDOS allows you to customize 4DOS to your personal
tastes. You would normally define the SETDOS variables
in your AUTOEXEC.BAT or 4START.BAT file. The SETDOS
options are:
C The COMPOUND argument is the character used for C
separating multiple commands on the same line.
The default character is the caret (^). You
cannot use any of the redirection characters
(<, >, and |) as the command separator.
E The ESCAPE argument is the character used to E
suppress the normal meaning of the following
character. Any character preceded by the
escape character will be passed unmodified to
the command line. The default escape character
is ^X. You cannot use any of the redirection
characters (<, >, and |) as the escape
character.
H The HISTORY variable determines the minimum H
command size to save. Any command line whose
length is less than this value will not be
saved to the history list. Setting /H to 256
will disable all history saves; setting it to 0
will save everything. The default value is 0.
M The MODE variable controls the line editing mode. M
4DOS defaults to overstrike mode (0). If MODE
is set to 1, the default is insert mode.
N The NOCLOBBER variable controls output N
redirection. If NOCLOBBER is set to 1, then
existing files may not be destroyed by output
redirection, and when appending with >>, the
output file must exist. NOCLOBBER can be
overridden with the ! character (see the
section on redirection in USING 4DOS). The
default value is 0.
4DOS Reference Manual 82
V The VERBOSE variable controls command echoing in V
batch files. If VERBOSE is set to 0, batch
files will NOT echo their input unless they set
ECHO ON. VERBOSE defaults to 1 (that is, batch
files WILL echo input).
Example: Change the COMPOUND character to a ~ (tilde):
c:\> setdos /c~ setdos /c~
Change MODE to insert, VERBOSE to off, and set
NOCLOBBER on:
c:\> setdos /m1 /v0 /n1 setdos /m1 /v0 /n1
4DOS Reference Manual 83
SETLOCAL SETLOCAL
Syntax: SETLOCAL SETLOCAL
Purpose: Save a copy of the current disk drive, directory,
and environment.
Comments: SETLOCAL is used in batch files to save the disk
drive, directory, environment variables, and aliases to
a reserved block of memory. You can then change their
values, and later restore the original values with
ENDLOCAL.
SETLOCAL and ENDLOCAL are not nestable within the
same batch file. However, you can have multiple
SETLOCAL / ENDLOCAL pairs within a batch file, and
nested batch files can each have their own SETLOCAL /
ENDLOCAL.
You cannot use SETLOCAL / ENDLOCAL in an alias.
See also ENDLOCAL.
Example: This batch file fragment saves the disk drive,
directory, and environment, changes the disk and
directory, modifies some variables, deletes all the
aliases, runs a program, and then restores the original
values:
setlocal
cdd d:\test
set path=c:\;c:\dos;c:\util
set lib=d:\lib
unalias *
rem run some program here
endlocal
4DOS Reference Manual 84
SHIFT SHIFT
Syntax: SHIFT [n] SHIFT [n]
Purpose: Allow the use of more than 10 variables in a batch
file.
Comment: SHIFT is provided for compatibility with COMMAND.COM.
COMMAND.COM supports only 10 parameters (%0 through
%9); 4DOS supports 128 parameters (%0 to %127), so
you may not need to use SHIFT for batch files running
exclusively under 4DOS.
SHIFT moves each of the batch file parameters n _
positions (i.e., %1 becomes %0, %2 becomes %1, etc.).
The default value for n is 1. You can also reverse a _
SHIFT, by giving a negative value for n (i.e., if n is _ _
-1, the former value for %0 is restored, %0 becomes %1,
%1 becomes %2, etc.).
Example: Create a batch file called TEST.BAT: ________
echo %1 %2 %3 %4
shift
echo %1 %2 %3 %4
shift 2
echo %1 %2 %3 %4
shift -1
echo %1 %2 %3 %4
Executing TEST.BAT produces the following results: ________
c:\> test zero one two three four five six test zero one two three four five six
zero one two three
one two three four
three four five six
two three four five
4DOS Reference Manual 85
TEE TEE
Syntax: TEE [/A] [d:][path]filename... TEE [/A] [d:][path]filename...
Purpose: Copy standard input to standard output, and save a
copy in the specified file(s).
Comments: The /A option causes the output to be appended to
the file(s) rather than overwriting it.
If you are typing at the keyboard, you need to enter
a ^Z to terminate the input.
TEE is often used to save the intermediate output of
a pipe.
See also Y.
Example: Search the file DOC for any lines containing the ___
string "4DOS", make a copy of the matching lines in
4.DAT, sort the lines, and write them to the output _____
file 4DOS.DAT: ________
c:\> find "4DOS" doc | tee 4.dat | sort > 4dos.dat find "4DOS" doc | tee 4.dat | sort > 4dos.dat
4DOS Reference Manual 86
TEXT TEXT
Syntax: TEXT TEXT
. .
. .
. .
ENDTEXT ENDTEXT
Purpose: Display a block of text in a batch file.
Comments: The TEXT command is useful for displaying menus or
multiple line messages. TEXT will display subsequent
lines in the batch file until terminated by ENDTEXT.
You can change screen colors by inserting an ANSI
escape sequence (see Appendix B).
See also ECHO and SCREEN.
Example: The following batch file fragment displays a simple
menu:
@echo off
cls
screen 2 0
test
Enter one of the following:
1 - Spreadsheet
2 - Word Processing
3 - DOS Utilities
Enter your selection :
endtext
4DOS Reference Manual 87
TIME TIME
Syntax: TIME [hh[:mm[:ss]]] TIME [hh[:mm[:ss]]]
Purpose: Display or set the current system time.
Comments: If you don't enter any parameters, TIME will display
the current system time and prompt you for a new time.
Press ENTER if you don't wish to change the time,
otherwise enter the new time.
The parameters for the TIME command are:
hh (hour) = 0 - 23 __
mm (minute) = 0 - 59 __
ss (second) = 0 - 59 __
Whenever you create or modify a file, the system
time is recorded in the directory entry.
Example: Enter the time (9:30 am):
c:\> time 9:30 time 9:30
To be prompted for the time:
c:\> time time
Mon Dec 25, 1989 9:30:10
New time (hh:mm:ss):
4DOS Reference Manual 88
TIMER TIMER
Syntax: TIMER TIMER
Purpose: System stopwatch.
Comments: The TIMER command turns the system stopwatch on and
off. The first time you run TIMER, the stopwatch
starts. When you run TIMER again, the stopwatch stops
and the elapsed time is displayed.
TIMER is particularly useful for timing events in
batch files.
The smallest interval TIMER can measure is .06
seconds; the largest interval is 23:59:59.99.
Example: Start the timer:
c:\> timer timer
Timer on
Stop the timer:
c:\> timer timer
Elapsed time: 0:00:08.06
4DOS Reference Manual 89
TYPE TYPE
Syntax: TYPE [/LP] [d:][pathname]filename... TYPE [/LP] [d:][pathname]filename...
Purpose: Display the contents of the specified file(s).
Comments: The TYPE command displays a file. Press ^S to
suspend the display, and any character key to continue
the display.
The /L option prints line numbers preceding each
line of text.
The /P option will pause after each page. Press ^C
to quit, or any other key to display the next page.
TYPE is normally only useful for displaying ASCII
text files; executable files (.COM & .EXE) and many
data files will be unreadable due to the presence of
non-alphanumeric characters.
You will probably find LIST to be more useful for
displaying files.
See also LIST.
Example: Display the files MEMO1 and MEMO2, pausing at the _____ _____
end of each page:
c:\> type /p memo1 memo2 type /p memo1 memo2
4DOS Reference Manual 90
UNALIAS UNALIAS
Syntax: UNALIAS alias... UNALIAS alias...
or
UNALIAS * UNALIAS *
Purpose: Remove aliases from the alias list.
Comments: UNALIAS also accepts the wildcard character * to
delete all aliases.
See also ALIAS and ESET.
Example: Remove the alias DDIR: ____
c:\> unalias ddir unalias ddir
Remove the aliases DDIR and ZAP: ____ ___
c:\> unalias ddir zap unalias ddir zap
Remove all the aliases:
c:\> unalias * unalias *
4DOS Reference Manual 91
VER VER
Syntax: VER VER
Purpose: Display the current 4DOS and MS-DOS versions.
Comments: The 4DOS and MS-DOS versions consist of a one digit
major version number, a period, and a two digit minor
version number.
Example: Get the current version of 4DOS and MS-DOS:
c:\> ver ver
4DOS 2.0 DOS 3.31
4DOS Reference Manual 92
VERIFY VERIFY
Syntax: VERIFY [on | off] VERIFY [on | off]
Purpose: Display, enable, or disable disk write verification.
Comments: When VERIFY is ON, MS-DOS will verify each disk
write to ensure the data has been written correctly.
VERIFY will remain ON until you set it OFF.
Entering VERIFY with no parameters will display the
current VERIFY state.
Verification will slow your disk write operations
slightly.
At system startup, VERIFY is OFF.
Example: Check the current verify status:
c:\> verify verify
VERIFY is OFF
Enable disk write verification:
c:\> verify on verify on
4DOS Reference Manual 93
VOL VOL
Syntax: VOL [d:]... VOL [d:]...
Purpose: Display the disk volume label(s).
Comments: If you don't enter a drive name, VOL will assume the
current disk drive.
If the disk doesn't have a volume name, VOL will
report it as "unlabeled."
Volume labels can be created, changed or deleted
with the MS-DOS LABEL command.
Example: Display the label for the default disk:
c:\> vol vol
Volume in drive C: is MYHARDDISK
Display the disk labels for drives A and B:
c:\> vol a: b: vol a: b:
Volume in drive A: is unlabeled
Volume in drive B: is BACKUP_2
4DOS Reference Manual 94
Y Y
Syntax: Y [d:][path]filename... Y [d:][path]filename...
Purpose: Copy standard input to standard output, and then
copy the specified file(s) to standard output.
Comments: Standard input from the console is terminated by a
^Z.
See also TEE.
Example: Get text from standard input, append the files MEMO1 _____
and MEMO2 to it, and send the output to MEMOS: _____ _____
c:\> y memo1 memo2 > memos y memo1 memo2 > memos
4DOS Reference Manual 95
APPENDIX A - 4DOS and MS-DOS Error Messages APPENDIX A - 4DOS and MS-DOS Error Messages
Access denied Access denied
You tried to erase or write to a read-only protected file, to
rename a file or directory to an existing name, or to remove a
directory with files still in it.
Alias loop Alias loop
An alias refers back to itself. (i.e., a = b = a), or aliases
are nested more than 16 deep. Correct your alias list.
Bad disk unit Bad disk unit
Generally caused by a disk drive failure. Try the diagnostic
tests.
Bad environment Bad environment
The MS-DOS environment has a bad structure. Reboot the
system.
Can't copy file to itself Can't copy file to itself
4DOS will not permit you to COPY or MOVE a file to itself.
Unlike COMMAND.COM, 4DOS does full path and filename expansion
before copying to ensure that files aren't inadvertently
destroyed.
Can't create Can't create
4DOS can't create the specified file. The disk may be full or
write protected, the file already exists and is read-only, or
the root directory is full.
Can't delete Can't delete
4DOS can't delete the specified file or directory. The disk
is probably write protected.
Can't get directory Can't get directory
4DOS can't read the specified directory. The disk drive is
probably not ready.
4DOS Reference Manual 96
Can't make directory entry Can't make directory entry
4DOS can't create the filename in the directory. This is
usually caused by a full root directory. Create a
subdirectory and move some of the files to it.
Can't open Can't open
4DOS can't open the specified file. Check your disk
directory.
Can't remove current directory Can't remove current directory
4DOS can't delete your current directory. Change to the
parent directory and try again.
Command line too long Command line too long
The command line exceeded 255 characters in length while 4DOS
was doing alias and variable expansion.
Data error Data error
MS-DOS can't read or write properly to the device.
Directory stack empty Directory stack empty
POPD or DIRS can't find any entries in the directory stack.
Directory stack full Directory stack full
The current directory stack size plus the size of the new
entry exceeds 255 characters. Use POPD to remove entries.
Disk is write protected Disk is write protected
The disk cannot be written to. Check the disk and remove the
write-protect tab if necessary.
Drive not ready--close door Drive not ready--close door
The floppy disk drive door is open. Close the door and try
again.
4DOS Reference Manual 97
Error reading Error reading
MS-DOS experienced an I/O error when reading from a device.
This is usually caused by a bad disk, a device not ready, or a
hardware error.
Error writing Error writing
MS-DOS experienced an I/O error when writing to a device.
This is usually caused by a full disk, a bad disk, a device
not ready, or a hardware error.
Exceeded nesting limit Exceeded nesting limit
You have attempted to nest batch files more than 5 levels
deep, or you have attempted more than 5 nested GOSUBS in a
single batch file.
File Allocation Table bad File Allocation Table bad
MS-DOS can't access the FAT on the specified disk. This can
be caused by a bad disk or a hardware error.
File exists File exists
The requested output file already exists, and 4DOS won't
overwrite it.
File not found File not found
4DOS couldn't find the specified file. Check your disk
directory.
General failure General failure
This is usually a hardware problem, particularly a disk drive
failure. Try to correct the problem or reboot and try again.
Internal DOS error Internal DOS error
MS-DOS encountered an internal bug and failed. Reboot the
system.
Invalid date Invalid date
An invalid date was entered. Check the syntax and reenter.
4DOS Reference Manual 98
Invalid drive Invalid drive
A bad or non-existent disk drive was specified.
Invalid option Invalid option
4DOS didn't recognize the specified option. Check the syntax
and reenter.
Invalid path Invalid path
The specified path does not exist. Check the disk
specification and/or spelling.
Invalid time Invalid time
An invalid time was entered. Check the syntax and reenter.
Label not found Label not found
A GOTO or GOSUB command referred to a non-existent label.
Check your batch file.
Memory destroyed Memory destroyed
The MS-DOS memory control blocks have been corrupted. Reboot
the system.
Missing ENDTEXT Missing ENDTEXT
A TEXT command is missing the matching ENDTEXT command. Check
your batch file.
Missing GOSUB Missing GOSUB
4DOS cannot perform the RETURN command in a batch file.
Either you tried to do a RETURN without a GOSUB, or your batch
file has been corrupted.
No aliases defined No aliases defined
No aliases were found in the environment.
4DOS Reference Manual 99
No closing quote or parenthesis No closing quote or parenthesis
4DOS couldn't find a second matching quote (either ` or "), or
the closing parenthesis on the command line.
No environment space No environment space
4DOS has run out of environment space. The environment is
used for storing both environment variables and the alias
list. Edit the SHELL command in the CONFIG.SYS file to
increase the environment size. Change the /E parameter to
read:
/E:n /E:n
where n is a number from 512 to 32000), and reboot the machine _
(See INSTALLATION).
Non-DOS disk Non-DOS disk
MS-DOS can't read the disk. Either the disk is bad, or it has
been formatted by a different operating system. Reformat it
as an MS-DOS disk.
Not an alias Not an alias
The specified argument is not in the 4DOS alias list.
Not in environment Not in environment
The specified argument is not in the environment.
Not ready Not ready
The specified device can't be accessed.
Not same device Not same device
This error usually appears in RENAME. You cannot rename a
file to a different disk drive.
4DOS Reference Manual 100
Out of memory Out of memory
MS-DOS or 4DOS had insufficient free memory to execute the
last command.
Out of paper Out of paper
MS-DOS detected an out-of-paper condition on one of the
parallel printers (LPT1, LPT2, or LPT3). Check your printer
and add paper if necessary.
Read error Read error
MS-DOS disk read error; usually caused by a bad disk or a non-
DOS disk.
Sector not found Sector not found
BIOS disk error; usually caused by a bad disk or a non-DOS
disk.
Seek error Seek error
MS-DOS can't seek to the proper location on the disk. This is
generally caused by a bad disk or drive.
Syntax error Syntax error
A command was entered with the improper format.
Too many open files Too many open files
MS-DOS has run out of file handles. Try setting FILES=20 or
more in the CONFIG.SYS file.
Unknown command Unknown command
A command was entered that 4DOS didn't recognize and couldn't
find in the current search path. Check the spelling or PATH
specification.
Write error Write error
MS-DOS disk error; usually caused by a bad disk or a non-DOS
disk.
4DOS Reference Manual 101
APPENDIX B - ANSI.SYS COMMANDS APPENDIX B - ANSI.SYS COMMANDS
The ANSI.SYS provided with 4DOS is a replacement for the standard
ANSI driver provided on your MS-DOS disk. It includes more ANSI
command sequences, EGA and VGA support, and runs 20% to 50% faster.
ANSI.SYS provides functions to position the cursor, change the
screen display, erase part or all of the screen, and assign key
functions.
ESC[#;#f ESC[#;#f
or or
ESC[#;#H CURSOR POSITION ESC[#;#H
Moves the cursor to the specified position. The
first parameter is the row and the second parameter
is the column. The default values are 1.
ESC[#A CURSOR UP ESC[#A
Moves the cursor up the number of rows specified,
or until it reaches the top of the screen. The
default value for # is 1.
ESC[#B CURSOR DOWN ESC[#B
Moves the cursor down the number of rows
specified, or until it reaches the bottom of the
screen. The default value for # is 1.
ESC[#C CURSOR FORWARD ESC[#C
Moves the cursor right the number of columns
specified, or until it reaches the right margin. The
default value for # is 1.
ESC[#D CURSOR BACKWARD ESC[#D
Moves the cursor left the number of columns
specified, or until it reaches the left margin.
the default value for # is 1.
ESC[#J CLEAR SCREEN ESC[#J
This sequence clears part or all of the display.
If # is 1, it clears from home (upper left corner)
to the cursor position. If # is 2, it clears the
entire screen and moves the cursor to the upper left
corner. The default value for # is 2.
4DOS Reference Manual 102
ESC[#K CLEAR IN LINE ESC[#K
This sequence clears part or all of the current
line. If # is 0, it clears from the cursor to the
end of the line. If # is 1, it clears from the
start of the line to the cursor. If # is 2, it
clears the entire line. The default value for #
is 0.
ESC[6n DEVICE STATUS REPORT ESC[6n
This sequence sends a cursor position report.
ESC[s SAVE CURSOR POSITION ESC[s
Saves the current cursor position internally. You
can restore the saved position with the RESTORE
CURSOR POSITION (ESC[u) command.
ESC[u RESTORE CURSOR POSITION ESC[u
Restores the cursor to the position saved with the
SAVE CURSOR POSITION command.
ESC[=#h SET MODE ESC[=#h
Sets the video mode, where # is:
0 40 x 25 B&W
1 40 x 25 Color
2 80 x 25 B&W
3 80 x 25 Color
4 320 x 200 Color (graphics)
5 320 x 200 B&W (graphics)
6 640 x 200 B&W (graphics)
7 Enable wrap at end of line.
ESC[=#i RESET MODE ESC[=#i
The parameters are the same as SET MODE, except if
# is 7, wrap is disabled (characters past the end of
line are discarded).
4DOS Reference Manual 103
ESC[#;...#m SET GRAPHICS RENDITION ESC[#;...#m
Sets the character display attribute. All
subsequent characters will be displayed with the
specified attribute until the attribute is
redefined.
0 All attributes off (white on black)
1 Bold
4 Underline (monochrome display)
5 Blink
7 Inverse video
8 Invisible
30 Black foreground
31 Red foreground
32 Green foreground
33 Yellow foreground
34 Blue foreground
35 Magenta foreground
36 Cyan foreground
37 White foreground
40 Black background
41 Red background
42 Green background
43 Yellow background
44 Blue background
45 Magenta background
46 Cyan background
47 White background
ESC[#;"string";...#p ESC[#;"string";...#p
or or
ESC[#;#;...#p KEYBOARD REASSIGNMENT ESC[#;#;...#p
The first # is the ASCII code being reassigned.
The remaining numbers or strings define the
keystrokes to be generated when the key is
intercepted. If the first # is a 0, the second #
defines an extended ASCII code.
4DOS Reference Manual 104
Appendix C - Key Codes Appendix C - Key Codes
Here are some of the extended key codes for the INKEY and
KEYSTACK commands (see the Command Reference Guide):
F1 - @59 Alt-F1 - @104 Ctl-F1 - @94 Shift-F1 - @84
F2 - @60 Alt-F2 - @105 Ctl-F2 - @95 Shift-F2 - @85
F3 - @61 Alt-F3 - @106 Ctl-F3 - @96 Shift-F3 - @86
F4 - @62 Alt-F4 - @107 Ctl-F4 - @97 Shift-F4 - @87
F5 - @63 Alt-F5 - @108 Ctl-F5 - @98 Shift-F5 - @88
F6 - @64 Alt-F6 - @109 Ctl-F6 - @99 Shift-F6 - @89
F7 - @65 Alt-F7 - @110 Ctl-F7 - @100 Shift-F7 - @90
F8 - @66 Alt-F8 - @111 Ctl-F8 - @101 Shift-F8 - @91
F9 - @67 Alt-F9 - @112 Ctl-F9 - @102 Shift-F9 - @92
F10 - @68 Alt-F10 - @113 Ctl-F10- @103 Shift-F10 - @93
Home @71
Up @72
PgUp @73
Left @75
Right @77
End @79
Down @80
PgDn @81
Insert @82
Del @83
Ctl-Left @115
Ctl-Right @116
Ctl-End @117
Ctl-PgDn @118
Ctl-PgUp @132
Ctl-Home @119
4DOS Reference Manual 105
Index Index
4D-PIF.DVP 9 Command
4DOS.EXE 8 completion 17
4DOS88.EXE 8 echoing 20
4DOS286.EXE 8 history and recall 17
4DOSSWAP.@@@ 11 line 2
4START.BAT 15, 82 line arguments 20
line editing 16
? 29 processor 51
separator 18, 82
ALIAS 20, 30 syntax 28
Alias parameters 21, 30 Comment 76
Aliases 2, 20, 50, 84, 91 COMPOUND 18, 82
ALIASES.BAT 9, 21 Conditional commands 3, 19
AND 19 Conditional execution 60
ANSI.SYS 8, 10, 102 CONFIG.SYS 10
Append 41 Configuration variables 82
Argument Quoting 20 COPY 41
ATTRIB 32 Country code 42
Attributes 32, 45 Current directory 37
AUTOEXEC.BAT 12, 15 Cursor 79
CWD 24
Batch file 7 CWDS 24
echoing 48
nesting 35 DATE 24, 42
parameters 85 DEL 43
BEEP 33 DESCRIBE 44
BREAK 34 DESCRIPT.ION 44
Descriptions 2
CALL 35 DESQView 13
CANCEL 36, 73 DIR 45
CD 37 Directory stack 47, 73
CDD 38 DIRS 47
CHCP 39 DISK 23
CHDIR 37 Disk space 54
CLS 40 Disk write verification 93
CMDLINE 23 DOS.HLP 8
Code page 39 DOSVER 23
Colon 56, 57
ECHO 20, 48, 83
4DOS Reference Manual 106
Editing 16 History size 12
EMS 11
ENDLOCAL 49, 84 I/O Redirection 25
ENDTEXT 87 IF 60
Environment INKEY 62, 105
size 2, 12 INPUT 63
space 67 INSTALL 10
variables 2, 23, 50, INSTALL.BAT 8
62, 63, 81, 84 Installation 8
EQ 60 Interrupt 11
ERASE 43 ISDIR 61
Error Messages 96
ERRORLEVEL 19, 60 Key Codes 105
ESCAPE 19, 82 KEYSTACK 8, 22, 64, 105
Escape character 19, 82 KEYSTACK.SYS 8, 10, 22, 64
ESET 50
EXCEPT 51 Label 56, 57, 94
EXIST 61 Language support 39
EXIT 52 LE 60
Exit code 19 Line editing mode 82
Expanded memory 67 LIST 65
Extended key codes 62, 105 LT 60
Extended memory 67
MARK 14
F9 and F10 16, 18 MD 66
File MEMORY 67
attributes 32, 45 MKDIR 66
descriptions 2, 44, 45 MODE 82
Filename completion 18 MOVE 68
FOR 53 Multiple arguments 4
FREE 54 Multiple Commands 2, 18
GE 60 NE 60
GLOBAL 55 NOCLOBBER 25, 82
GOSUB 56, 78
GOTO 57 OR 19
GT 60
PATH 23, 66, 69
HELP 58 PAUSE 70
HELP.EXE 8 Pipes 26, 86
HISTORY 59, 82 POPD 71
History list 17, 59 PROMPT 72
4DOS Reference Manual 107
PUSHD 72 UNALIAS 20, 30, 91
Using 4DOS 15
QUIT 73
Quotes 20 VER 92
VERBOSE 20, 48, 76, 83
RAM 67 VERIFY 41, 93
RD 75 Version number 92
README.DOC 9 VOL 94
Redirection 3, 82 Volume label 94
RELEASE 14
REM 76 Wildcards 1
REN 77
RENAME 77 Y 95
RETURN 56, 78
RMDIR 75
Root directory 66
SCREEN 79
SELECT 80
SET 23, 81
SETDOS 17, 18, 19, 20, 25,
48, 76, 82
SETLOCAL 49, 84
SHIFT 85
Stack Overflow 14
Standard
error 24
input 25, 86, 95
output 25, 86, 95
Starting 4DOS 15
Startup options 12
Stopwatch 89
Subroutine 56, 78
TEE 86
TEXT 87
TIME 24, 88
TIMER 89
TSRCOM 14
TYPE
4DOS Reference Manual 108