DR DOS 9.0 USER GUIDE ========== Copyright (c) 2022-2026 Whitehorn Ltd. Co. All rights reserved. DR DOS is a registered trademark of Whitehorn Ltd. Co. WHITEHORN LTD. CO. 3963 S Highway 97 #214 Sand Springs, OK 74063 DISCLAIMER Whitehorn Ltd. Co. provides this publication "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability or fitness for a particular purpose. This publication may include technical inaccuracies or typographical errors. Changes are periodically made to the information herein. No part of this publication may be reproduced without the prior written permission of Whitehorn Ltd. Co. Last Modified: November 2026 =============================================================================== TABLE OF CONTENTS =============================================================================== Chapter 1 ......................................... Installing DR DOS Chapter 2 ......................................... Getting Started Chapter 3 ......................................... Working with Files Chapter 4 ......................................... Working with Directories Chapter 5 ......................................... Running Programs Chapter 6 ......................................... Advanced Features Chapter 7 ......................................... Command Reference Appendix A ........................................ Error Messages Appendix B ........................................ Batch Programming Guide Appendix C ........................................ Reporting Bugs and Issues Glossary =============================================================================== CHAPTER 1: INSTALLING DR DOS =============================================================================== SYSTEM REQUIREMENTS DR DOS 9.0 requires the following hardware: Processor Intel 386 or compatible Memory 2 MB RAM (minimum) Display VGA-compatible display adapter Storage FAT12 or FAT16 hard disk partition BIOS LBA or CHS disk addressing BETA SOFTWARE NOTICE DR DOS 9.0 is currently in beta testing. This means you may encounter bugs, crashes, system freezes, filesystem corruption, or compatibility issues during use. IMPORTANT PRECAUTIONS: - Back up all important data before installation - Do not use DR DOS 9.0 on production systems - Test in a virtual machine or on non-critical hardware - Be prepared for potential data loss Your participation in beta testing helps us identify and fix issues. Please report any problems you encounter (see "Reporting Bugs and Issues" section). SUPPORTED STORAGE DR DOS 9.0 supports FAT12 and FAT16 partitions on hard disks and floppy drives: Supported: FAT12 and FAT16 hard disk partitions FAT12 floppy disks (3.5-inch, 720K and 1.44MB) Booting from hard disk or 1.44MB floppy disk LBA disk addressing CHS disk addressing Drive letters: A: (floppy drive, auto-detected at boot) B: (floppy alias; shares physical drive with A: on single-floppy systems) C: (first hard disk partition) D:-R: (additional hard disk partitions, auto-detected; includes primary partitions and logical drives in extended partitions) AVAILABLE LANGUAGES DR DOS 9.0 is available in the following languages: English (en) All system messages, boot text, and error messages in English German (de) Alle Systemmeldungen, Starttexte und Fehlermeldungen auf Deutsch Each release includes separate disk images for each language. The two-letter language code appears in the image filename: boot16_en.img.7z English hard disk image boot16_de.img.7z German hard disk image floppy144_en.img.7z English floppy disk image floppy144_de.img.7z German floppy disk image The images are identical in functionality; only the language of system messages differs. This manual uses the English (en) filenames in all examples. Substitute _de for _en if you prefer the German version. INSTALLATION PROCEDURE DR DOS 9.0 is available in two formats: boot16_xx.img.7z Pre-configured bootable hard disk image floppy144_xx.img.7z Bootable 1.44MB floppy disk image with installer where xx is the language code (en for English, de for German). Choose the method that best fits your hardware or emulator setup. METHOD 1: HARD DISK IMAGE (RECOMMENDED) The hard disk image is a ready-to-use bootable disk with DR DOS pre-installed. This is the fastest way to get started. Step 1: Obtain the disk image Download boot16_en.img.7z from the DR DOS website (https://www.dr-dos.com). Step 2: Extract the disk image Use 7-Zip to extract the image file: 7z x boot16_en.img.7z This creates boot16_en.img (approximately 120 MB). The image is a disk of 243 cylinders, 16 heads and 63 sectors per track. If your emulator asks for the hard disk geometry, use these values. Step 3: Write the image to bootable media Use dd or a similar disk imaging tool to write the image to a CompactFlash card, USB drive, or virtual disk: dd if=boot16_en.img of=/dev/sdX bs=4M status=progress Replace /dev/sdX with your target device identifier. IMPORTANT: Ensure you specify the correct device. Writing to the wrong device will destroy data on that device. Step 4: Boot from the media Configure your computer or emulator to boot from the media you created. DR DOS will load automatically and present the command prompt. METHOD 2: FLOPPY DISK INSTALLATION The floppy image is a bootable 1.44MB 3.5-inch floppy disk that includes an installer for setting up DR DOS on a hard disk. Use this method when installing DR DOS onto a new or empty hard disk, or on real hardware with a floppy drive. Step 1: Obtain the floppy image Download floppy144_en.img.7z from the DR DOS website (https://www.dr-dos.com). Step 2: Extract the floppy image Use 7-Zip to extract the image file: 7z x floppy144_en.img.7z This creates floppy144_en.img (1.44 MB). Step 3: Write the image to a floppy disk or virtual floppy For a physical floppy disk: dd if=floppy144_en.img of=/dev/fdX bs=512 For a virtual machine, attach floppy144_en.img as a floppy disk drive. Step 4: Boot from the floppy disk Configure your computer or emulator to boot from the floppy drive. DR DOS will load and present the command prompt. Step 5: Partition the hard disk (if needed) If your hard disk does not already have a DOS partition, use FDISK to create one: A:\>FDISK Follow the on-screen prompts to create a primary DOS partition. Reboot after partitioning. Step 6: Run the installer At the A:\> prompt, run the installation utility: A:\>INSTALL INSTALL will: - Format drive C: and transfer system files - Copy EMM386.SYS and ATAPICD.SYS to C:\ - Create C:\DOS and copy these files into it: BATCH.COM, CDEX.EXE, CLS.COM, DATE.COM, DIR.COM, EDIT.COM, FDISK.COM, FORMAT.COM, HEXDUMP.COM, JMP.COM, MEM.COM, MORE.COM, MOUSE.COM, MOVE.EXE, PEEK.COM, POKE.COM, REBOOT.COM and TYPE.COM WARNING: INSTALL formats drive C:, destroying all existing data. Step 7: Reboot from the hard disk Remove the floppy disk and reboot. DR DOS will start from drive C:. RUNNING IN QEMU QEMU is a popular open-source emulator for testing DR DOS. Hard disk image: qemu-system-i386 -m 16M -drive file=boot16_en.img,format=raw,if=ide -cpu 486 Hard disk image, with a CD-ROM disc image (an ISO file) in the drive: qemu-system-i386 -m 16M -cpu 486 \ -drive file=boot16_en.img,format=raw,if=ide \ -cdrom disc.iso Floppy installation (with an empty 128MB hard disk): qemu-img create -f raw hdd.img 128M qemu-system-i386 -m 16M -cpu 486 \ -drive file=hdd.img,format=raw,if=ide \ -drive file=floppy144_en.img,format=raw,if=floppy,index=0 \ -boot a To read the disc, load ATAPICD.SYS and run CDEX as "CD-ROM DRIVES (ATAPICD.SYS AND CDEX)" in Chapter 6 describes. WHAT'S INCLUDED The hard disk image (boot16_en.img) includes: - DR DOS 9.0 kernel and boot loader - COMMAND.COM (command interpreter) - Standard DOS utilities in C:\DOS\ - ATAPICD.SYS CD-ROM device driver in C:\ - CDEX.EXE CD-ROM extension in C:\DOS\ - FAT16 filesystem pre-configured on drive C: The floppy disk image (floppy144_en.img) includes: - DR DOS 9.0 kernel and boot loader - COMMAND.COM (command interpreter) - Standard DOS utilities in DOS\ - INSTALL.BAT installation utility - EMM386.SYS expanded memory manager - ANSI.SYS console driver (ANSI escape sequence support) - ATAPICD.SYS CD-ROM device driver - CDEX.EXE CD-ROM extension in DOS\ =============================================================================== CHAPTER 2: GETTING STARTED =============================================================================== WHAT IS DR DOS? DR DOS 9.0 is a disk operating system. It provides the essential services that allow you to run programs, manage files, and organize your hard disk. When you turn on your computer, DR DOS loads automatically and presents you with a command prompt. THE COMMAND PROMPT After DR DOS starts, you will see a prompt that looks like this: C:\> This prompt tells you: - The current drive (C:) - The current directory (\, the root) - That the system is ready for your command (>) You type commands at this prompt and press ENTER to execute them. While typing a command, you can use Backspace to erase the previous character, or press Esc to erase everything you have typed so far. Esc clears the characters from the screen and leaves the cursor back at the prompt, ready for you to type the command again. Press ENTER to execute the command. DRIVES AND DRIVE LETTERS DR DOS identifies disk drives with letters: A: Floppy drive (3.5-inch, auto-detected at boot) B: Floppy drive alias (shares physical drive with A: on single-floppy systems) C: First hard disk partition D:-R: Additional hard disk partitions (auto-detected at boot if present) Each CD-ROM drive also takes a drive letter, which the CDEX command assigns (D: when C: is the only hard disk partition). See "CD-ROM DRIVES (ATAPICD.SYS AND CDEX)" in Chapter 6. If no floppy drive is present, or if no floppy disk is inserted when the system starts, A: and B: will not be available. On single-floppy systems, A: and B: refer to the same physical drive. DR DOS automatically detects when a floppy disk has been swapped; no command or reboot is required after inserting a different disk. The current directory is preserved across disk changes. To switch to a different drive, type the drive letter followed by a colon and press ENTER: C:\>A: A:\> C:\>D: D:\> The prompt changes to show your new current drive. CONVENTIONS USED IN THIS MANUAL Commands are shown in UPPERCASE: DIR COPY Parameters you supply are shown in lowercase: COPY source destination Optional parameters are shown in brackets: DIR [drive:] Literal characters you must type exactly are shown as-is: C:\DOS\ BUILT-IN VS EXTERNAL COMMANDS DR DOS commands fall into two categories: BUILT-IN COMMANDS are part of COMMAND.COM itself and are always available, even if no external files are present: CD Change directory (also: CHDIR) COPY Copy files DEL Delete files (also: ERASE) ECHO Display messages or control command echoing EXIT Exit command interpreter HILOAD Load program into upper memory (also: LOADHIGH, LH) IF Conditional command execution MD Create directory (also: MKDIR) RD Remove directory (also: RMDIR) REN Rename files and directories (also: RENAME) PATH Display or set the executable search path SET Display or modify environment variables VER Display version EXTERNAL COMMANDS are separate program files (.COM or .EXE) that must be present in the current directory or in a directory listed in the PATH environment variable (C:\DOS\ by default) to work: ATTRIB Display or change file attributes BATCH Batch file interpreter (invoked automatically for .BAT files) CDEX CD-ROM extension (TSR) CLS Clear screen DATE Display or set system date DIR Directory listing EDIT Full-screen text editor FDISK Partition hard disks FORMAT Format and create filesystems on disk partitions HEXDUMP Display hexadecimal file dump JMP Execute code at memory address KEYB Keyboard layout driver (TSR) MEM Display memory information MORE Page through text output MOUSE PS/2 mouse driver (TSR) MOVE Move files PEEK Read byte from memory POKE Write byte to memory REBOOT Restart system TIME Display or set system time TREE Display directory hierarchy TYPE Display file contents XCOPY Copy files and directory trees If you receive "Command or filename not recognized" for an external command, verify that the program file exists in the current directory or in a directory listed in your PATH (see the PATH command). =============================================================================== CHAPTER 3: WORKING WITH FILES =============================================================================== FILE NAMES Every file has a name consisting of up to 8 characters, optionally followed by a period and an extension of up to 3 characters: LETTER.TXT REPORT.DOC COMMAND.COM CONFIG.SYS The extension often indicates the type of file: .COM Executable program .EXE Executable program .TXT Text file .SYS System configuration file File names cannot contain these characters: < > : " | ? * / \ WILDCARD CHARACTERS Two special characters help you work with groups of files: * Matches any sequence of characters ? Matches any single character Examples: *.TXT All files with .TXT extension REPORT.* All files named REPORT with any extension FILE?.DOC FILE1.DOC, FILE2.DOC, FILEA.DOC, etc. VIEWING FILES: DIR The DIR command displays a list of files in a directory. Syntax: DIR [filespec] [/W] Switches: /W Wide format (5 columns, filenames only) Examples: DIR List all files in current directory DIR *.TXT List all .TXT files DIR /W List files in wide format DIR D: List all files on drive D: DIR \DOS List the files in the directory \DOS DIR displays the volume label (up to 11 characters) and serial number (if present), then a "Directory of" line naming the directory that is listed, followed by the file name, size in bytes, date (MM-DD-YY), and time (H:MMa/p) for each file, followed by the total number of files found. With the /W switch, DIR displays only file names in a compact 5-column format without size, date, or time information. VIEWING FILE CONTENTS: TYPE The TYPE command displays the contents of a text file on screen. Syntax: TYPE filename Example: TYPE README.TXT NOTE: TYPE is an external command. The file TYPE.COM must be in the current directory or in a directory on your PATH (C:\DOS\ by default) for this command to work. TIP: For long files, use TYPE filename | MORE to page through the output one screen at a time. WARNING: Using TYPE on a program file (.COM or .EXE) will display meaningless characters and may cause your screen to behave erratically. Only use TYPE on text files. If TYPE cannot show the file, it prints one of these messages and ends with exit code 1: File not found The file does not exist. Invalid directory specified A directory in the path does not exist. Access denied The name is a directory. Invalid drive specified The drive does not exist. Too many files open Too many files are already open. Physical Media Error The drive could not be read, for example a floppy drive with no disk after you answered Fail, or a CD-ROM drive with no disc. Internal Error Code nnn Any other error. COPYING FILES: COPY The COPY command makes a duplicate of a file, or of every file that matches a wildcard. Syntax: COPY source [destination] Examples: COPY LETTER.TXT LETTER.BAK COPY D:DATA.TXT C:\DOCS\DATA.TXT COPY REPORT.DOC D:REPORT.DOC The destination is the name of the new file, or a directory or drive that receives a file with the same name as the source: COPY LETTER.DOC D: COPY LETTER.DOC C:\DOCS\ A destination that ends in a backslash, is a bare drive letter, or names an existing directory is a directory. If you leave the destination out, the files are copied into the current directory. Copying several files: A source with * or ? in it names every file that matches. COPY prints the name of each file it copies, and the number of files at the end: COPY C:\DOCS\*.TXT D:\BACKUP\ C:\DOCS\LETTER.TXT C:\DOCS\REPORT.TXT 2 file(s) copied Directories, hidden files and system files are not copied. When nothing matches, COPY prints the name, "File not found" and a count of 0. The destination decides what happens to the files: - A directory receives each file under its own name. - A name with * or ? in its last part is a pattern for the new names: each ? keeps the character of the source name, each * keeps the rest of it, and any other character replaces it. COPY *.TXT *.BAK makes a .BAK copy of every .TXT file. COPY *.TXT X*.* gives A1.TXT the name X1.TXT. - Any other name, one that is not a directory and has no wildcard, receives all the files joined into one file: COPY *.TXT ALL.TXT. End a directory name with a backslash to be sure the files go into it: without one, a directory that does not exist is taken as a file name, and all the files are joined into it. COPY stops at the first error. DELETING FILES: DEL The DEL command deletes one or more files from your disk. Syntax: DEL filename ERASE filename Examples: DEL LETTER.TXT ERASE REPORT.DOC DEL *.BAK DEL and ERASE are identical commands. Deleting every file in a directory (DEL *.*) asks "Are you sure (Y/N) ?" first. Type Y and press Enter to confirm. Naming a directory (DEL dir) deletes all the files in it, after the same question. CREATING DIRECTORIES: MD The MD command creates a new directory. Syntax: MD dirname MKDIR dirname Examples: MD DOCS MKDIR BACKUPS Notes: - MD and MKDIR are identical commands. - The parent directory must already exist. - If a directory with the same name already exists, MD will return an error instead of creating a duplicate entry. RENAMING FILES AND DIRECTORIES: REN The REN command renames an existing file or directory. It can also move a file to a different directory on the same drive. Syntax: REN oldname newname RENAME oldname newname Examples: REN OLD.TXT NEW.TXT RENAME LETTER.DOC LETTER.BAK REN DOCS ARCHIVE REN \WORK\FILE.TXT \DONE\FILE.TXT REN and RENAME are identical commands. MOVING FILES: MOVE The MOVE command relocates a file from one location to another. Unlike COPY, the original file is removed after a successful move. Syntax: MOVE source destination Examples: MOVE OLDFILE.TXT NEWFILE.TXT MOVE C:\DOCS\LETTER.TXT C:\BACKUP\ If the destination file already exists, MOVE asks whether to overwrite it. MOVE also renames with patterns (MOVE *.TXT *.BAK) and moves files to and from CD-ROM and network drives; see MOVE in Chapter 7. NOTE: MOVE is an external command. The file MOVE.EXE must be in the current directory or in a directory on your PATH (C:\DOS\ by default). =============================================================================== CHAPTER 4: WORKING WITH DIRECTORIES =============================================================================== WHAT IS A DIRECTORY? A directory is a container for files. Directories can contain other directories, creating a tree-like structure for organizing your files. Every disk has a root directory, indicated by a single backslash (\). All other directories branch from the root. Example directory structure: C:\ \DOS\ COMMAND.COM TYPE.COM MOVE.EXE \DOCS\ LETTER.TXT REPORT.DOC \PROGRAMS\ EDITOR.EXE PATHS A path describes the location of a file or directory. It consists of an optional drive letter, followed by a series of directory names separated by backslashes, ending with a filename: C:\DOCS\LETTER.TXT This path indicates: - Drive C: - In the DOCS directory - The file LETTER.TXT CHANGING DIRECTORIES: CD The CD (Change Directory) command changes your current directory or displays the current directory path. Syntax: CD [drive:][path] Examples: CD Display current directory CD \ Go to root directory CD \DOCS Go to DOCS directory CD .. Go to parent directory CD SUBDIR Go to subdirectory named SUBDIR CD D: Show drive D:'s current directory The CD command can also be typed as CHDIR. Spaces are optional when using .. or \ as the path (CD.. and CD\ also work). CD D: only shows drive D:'s current directory. It does not switch you to drive D:. To switch drives, type D: on its own. =============================================================================== CHAPTER 5: RUNNING PROGRAMS =============================================================================== EXECUTABLE FILES Programs are stored as executable files with .COM or .EXE extensions. To run a program, type its name (with or without the extension) and press ENTER: EDIT EDIT.COM MYPROG.EXE DR DOS searches for the program by trying each directory in turn: first the current directory, then each directory listed in the PATH environment variable, from left to right. Within each directory it tries the .COM, .EXE, and .BAT extensions in that order, and runs the first match: For the current directory, then each PATH entry: 1. directory\program.COM 2. directory\program.EXE 3. directory\program.BAT The default PATH is C:\DOS, so the standard utilities in C:\DOS\ are found automatically. Use the PATH command to add your own directories. If a directory in PATH is on a drive with no disk, the "Abort, Retry, Fail ?" prompt appears. Press F and DR DOS prints "Search path contains invalid drive" and goes on with the next directory in PATH. Batch files (.BAT) are text files containing a series of commands. When a .BAT file is found, DR DOS automatically invokes the BATCH.COM interpreter to execute it. See Chapter 6 for details on batch files. NOTE: The executable search path is configurable through the PATH environment variable. Type PATH to display it, PATH followed by a list of directories to set it (for example, PATH C:\DOS;C:\TOOLS), or PATH ; to clear it. The current directory is always searched first, before any PATH entry. PASSING PARAMETERS TO PROGRAMS Most programs accept parameters that control their behavior. Type the parameters after the program name, separated by spaces: TYPE README.TXT COPY FILE1.TXT FILE2.TXT MOVE /? Consult the documentation for each program to learn its parameters. Most external commands accept /? or /H to display a brief help screen describing their syntax and switches: FORMAT /? MEM /H EXITING PROGRAMS Most programs return to the DOS prompt when they finish. Some programs require you to type a command like EXIT or QUIT, or press a key combination. Consult each program's documentation. THE EXIT COMMAND The EXIT command ends the command interpreter and returns you to the program that started it. =============================================================================== CHAPTER 6: ADVANCED FEATURES =============================================================================== I/O REDIRECTION DR DOS supports redirecting a command's input and output using the redirection operators. Output Redirection (>) Syntax: command > filename The output that would normally appear on screen is instead written to the specified file. If the file already exists, it will be overwritten without warning, unless it is read-only (see below). Examples: DIR > FILELIST.TXT DIR *.COM > PROGRAMS.TXT MEM > MEMORY.TXT A read-only file is never overwritten or appended to. When the file named after > or >> is read-only, is a directory, or cannot be created because the root directory is full, DR DOS prints "Access denied" on the screen and does not run the command. The file and ERRORLEVEL are left as they were, and a batch file goes on with its next line. Example: ATTRIB +R NOTES.TXT TYPE LETTER.TXT > NOTES.TXT Access denied, NOTES.TXT unchanged Append Redirection (>>) Syntax: command >> filename Appends the command's output to the end of the specified file. If the file does not exist, it is created. Unlike >, existing content is preserved. Examples: ECHO Log started >> LOG.TXT DIR *.COM >> FILELIST.TXT Input Redirection (<) Syntax: command < filename Feeds the contents of the specified file to the command in place of keyboard input. This is useful for commands such as MORE. Examples: MORE < README.TXT MORE < NOTES.TXT > COPY.TXT A command line may combine < and > (or >>) in either order. If the program asks for more input than the file holds, it waits for keyboard input after the end of the file: type the rest of the input (end a line with Enter), or press Ctrl+C, which stops most programs. PIPING DR DOS supports piping the output of one command to the input of another using the pipe symbol (|). The output of the first command becomes the input of the second. Syntax: command1 | command2 command1 | command2 | command3 Examples: DIR | MORE Page through a directory listing MEM /A | MORE Page through the full memory report TREE C:\ | MORE Page through the directory tree NOTES: - The exit code (ERRORLEVEL) of a pipeline is the exit code of the last stage - A command line can have up to eight stages BATCH FILES DR DOS supports batch file scripting. A batch file is a text file with a .BAT extension that contains a series of commands to be executed in sequence. Batch files are useful for automating repetitive tasks. Creating a Batch File: Use the EDIT command or any text editor to create a file with a .BAT extension. Each line contains one command: Example: CLEANUP.BAT ---------------------- @ECHO OFF ECHO Cleaning up temporary files... DEL *.TMP DEL *.BAK ECHO Done. Running a Batch File: Type the batch file name (with or without the .BAT extension): C:\>CLEANUP C:\>CLEANUP.BAT Supported Batch Commands: Flow Control: REM comment Comment line (ignored) ECHO message Display message on screen ECHO OFF/ON Disable/enable command echoing ECHO. Display a blank line @command Execute command without echoing it PAUSE Wait for a keypress GOTO label Jump to a label GOTO :EOF Exit the current batch file :label Define a label CALL filename [args] Execute another batch file and return Conditionals: IF EXIST file cmd Execute cmd if file exists IF NOT EXIST file cmd Execute cmd if file does not exist IF ERRORLEVEL n cmd Execute cmd if last exit code >= n IF NOT ERRORLEVEL n cmd Execute cmd if last exit code < n IF "s1"=="s2" cmd Execute cmd if strings are equal IF NOT "s1"=="s2" cmd Execute cmd if strings differ File Operations: COPY src dest Copy a file or the files of a wildcard DEL file Delete a file (also: ERASE) REN old new Rename a file (also: RENAME) MD dirname Create a directory (also: MKDIR) RD dirname Remove an empty directory (also: RMDIR) CD path Change current directory (also: CHDIR) Variables: %0 - %9 Command-line parameters %VARNAME% Environment variable expansion SHIFT Shift parameters left (%1->%0, %2->%1, ...) SET Display all environment variables SET prefix Display variables starting with prefix SET VAR=value Set environment variable Redirection and Piping: command > file Redirect output to a file command >> file Append output to a file command < file Redirect input from a file command1 | command2 Pipe output to another command Parameter Substitution: Batch files can accept parameters. Use %0 through %9 to reference them: %0 The batch file name itself %1 First parameter %2 Second parameter ... %9 Ninth parameter Use SHIFT to access more than 9 parameters. Each SHIFT moves all parameters down by one position (%2 becomes %1, %3 becomes %2, etc.). Example batch file (BACKUP.BAT): @ECHO OFF ECHO Backing up %1 to %2... COPY %1 %2 ECHO Backup complete. Running: BACKUP.BAT README.TXT D:\BACKUP\README.TXT Environment Variables: Access environment variables using %VARNAME% syntax: ECHO The COMSPEC is: %COMSPEC% IF "%MYVAR%"=="" ECHO MYVAR not set Use SET to display, search, or modify environment variables: SET Display all variables SET P Display variables starting with P SET VAR=value Set VAR to value SET VAR= Remove VAR from the environment Conditional Execution: The IF command allows conditional execution: IF EXIST CONFIG.SYS ECHO Config file found IF NOT EXIST TEMP MD TEMP IF "%1"=="" ECHO No parameter provided IF ERRORLEVEL 1 ECHO Program returned an error ERRORLEVEL tests the exit code of the previous program. The condition is true if the exit code is greater than or equal to the specified value. Test higher values first: PROGRAM.EXE IF ERRORLEVEL 2 GOTO FATAL IF ERRORLEVEL 1 GOTO WARNING ECHO Success! Labels and GOTO: Use labels and GOTO for flow control: @ECHO OFF IF "%1"=="" GOTO USAGE ECHO Processing %1... GOTO END :USAGE ECHO Usage: PROCESS filename :END Use GOTO :EOF to exit the batch file immediately without requiring an :END label. Calling Other Batch Files: Use CALL to execute another batch file and return to continue: @ECHO OFF ECHO Starting installation... CALL SETUP.BAT ECHO Setup complete, running configuration... CALL CONFIG.BAT ECHO All done! Without CALL, executing a batch file transfers control permanently and does not return to the calling script. NOTES: - Batch file support requires BATCH.COM on your PATH (C:\DOS\ by default) - Use SET to view or modify environment variables - Use SHIFT to process more than 9 parameters AUTOEXEC.BAT - Automatic Startup Script DR DOS automatically executes C:\AUTOEXEC.BAT at boot time if it exists. This batch file runs once during system startup, before the first command prompt appears. If C:\AUTOEXEC.BAT does not exist, the system boots directly to the command prompt with no error message. Common uses for AUTOEXEC.BAT: - Setting environment variables (SET TEMP=C:\TEMP) - Loading keyboard layout drivers (KEYB DE) - Loading mouse drivers (MOUSE) - Displaying a welcome message - Launching a menu or application Example AUTOEXEC.BAT: @ECHO OFF SET TEMP=C:\TEMP ECHO Loading DR DOS... KEYB DE MOUSE ECHO. ECHO Welcome to DR DOS 9.0 ECHO. CONFIG.SYS - System Configuration DR DOS processes C:\CONFIG.SYS at boot time if it exists. This file configures system settings and loads device drivers before the command prompt appears. If C:\CONFIG.SYS does not exist, the system boots with default settings. Creating CONFIG.SYS: Use the EDIT command to create C:\CONFIG.SYS. Each line contains one directive: Example: CONFIG.SYS ---------------------- DEVICE=ANSI.SYS DEVICE=C:\EMM386.SYS Supported Directives: DEVICE=path Load a device driver from the specified path Example: DEVICE=C:\EMM386.SYS DEVICE=C:\DRIVERS\FOO.SYS The DEVICE directive loads a device driver during boot. Both flat binary (.SYS) and executable (.EXE) driver formats are supported; DR DOS detects the format automatically. The driver remains resident in memory and provides services to the system and applications. If the driver file cannot be found, or the path names a directory instead of a driver file (for example DEVICE C:\DOS), the message "Bad or missing" and the path is shown, nothing is loaded, and startup continues with the next line. DEVICEHIGH and HIDEVICE behave the same way. DEVICEHIGH=path Load a device driver into upper memory Example: DEVICE=C:\EMM386.SYS DOS=HIGH,UMB DEVICEHIGH=C:\ANSI.SYS Loads the specified device driver into an upper memory block (UMB), freeing conventional memory for applications. Two prerequisites must appear on EARLIER lines in CONFIG.SYS: DEVICE=EMM386.SYS DOS=HIGH,UMB EMM386 creates the upper memory regions and DOS=UMB tells the kernel to manage them. If either prerequisite is missing, or if it appears after the DEVICEHIGH= line, DEVICEHIGH= loads the driver into conventional memory silently, exactly as DEVICE= does. CONFIG.SYS is processed from top to bottom. The driver is placed in the largest free upper memory block. If no block is large enough, it loads into conventional memory. Check the result with MEM /U. HIDEVICE=path Same as DEVICEHIGH= (DR DOS spelling) Example: HIDEVICE=C:\ANSI.SYS HIDEVICE loads drivers exactly like DEVICEHIGH. SIZE option. DEVICEHIGH and HIDEVICE accept a SIZE=hhhh option right after the keyword: HIDEVICE SIZE=2000 C:\ANSI.SYS DEVICEHIGH SIZE=2000 C:\ANSI.SYS hhhh is a number of bytes in hexadecimal (either case). The driver is loaded into upper memory only if the largest free upper memory block has at least that much room; otherwise it is loaded into conventional memory, silently. Nothing is reserved: the driver still uses only the memory it needs. SIZE=10000 or larger asks for more than any upper memory block has, so the driver loads into conventional memory. Delimiters in CONFIG.SYS. Between a directive and its value you may use blanks, TABs and an equal sign in any combination, for every directive. All of these are the same: LASTDRIVE=Z LASTDRIVE = Z LASTDRIVE Z DOS=[HIGH|LOW][,UMB|,NOUMB] Control DOS memory configuration Example: DOS=HIGH,UMB Controls DOS memory placement and upper memory block (UMB) availability. HIGH loads DOS into the High Memory Area (HMA), which is the default. LOW loads DOS into conventional memory. UMB makes upper memory blocks available to programs; NOUMB (or omitting the UMB option) keeps UMBs unavailable. FILES=N Set the number of available file handles Example: FILES=20 Sets the maximum number of simultaneously open file handles, from 8 to 36. Without a FILES line the limit is 36. SHELL=path [args] Specify an alternate command interpreter Example: SHELL=C:\DOS\COMMAND.COM /E:512 Loads the specified program as the command interpreter instead of the default COMMAND.COM. The filename is extracted from the path and must be in 8.3 format. The /E:nnn switch sets the size of the environment in bytes, from 160 to 32768, to leave room for environment variables. Without /E: the environment holds 256 bytes. LASTDRIVE=X Set the highest valid drive letter Example: LASTDRIVE=F Controls the highest drive letter recognized by the system. Default is E. Setting a higher value extends the range of valid drive letters (e.g., LASTDRIVE=Z allows A: through Z:). A LASTDRIVE line without a drive letter A to Z is ignored. A CD-ROM drive needs a letter within LASTDRIVE; see "CD-ROM DRIVES (ATAPICD.SYS AND CDEX)" in Chapter 6. BREAK=ON|OFF Enable or disable extended Ctrl-C checking Example: BREAK=ON When set to ON, DR DOS checks for Ctrl-C before every DOS call, not just during character I/O operations. This makes long-running operations more responsive to Ctrl-C. Default is OFF. INSTALL=path [args] Load and run a program at boot Example: INSTALL=C:\DOS\MOUSE.COM Loads and executes the specified program during boot, before COMMAND.COM starts. Useful for loading terminate-and-stay-resident (TSR) utilities. Any text after the program path is passed to it as command-line arguments. If the program cannot be found or run, the line is skipped and startup continues. NUMLOCK=ON|OFF Set the NumLock keyboard state at boot Example: NUMLOCK=OFF Turns the NumLock key on or off during boot and updates the keyboard LED to match. COUNTRY=nnn[,[cp]] Set the country code and code page Example: COUNTRY=049,850 Sets the country code (nnn) and optional code page (cp). REM comment Comment line Example: REM This line is ignored A CONFIG.SYS comment. The entire line is ignored, allowing you to annotate your configuration. BUFFERS=N Set the number of disk buffers (reserved) STACKS=N,S Set interrupt stack parameters (reserved) FCBS=N Set the number of FCB handles (reserved) SWITCHES=/x Set startup switches (reserved) These directives are recognized but have no effect in this release. They are accepted for compatibility with CONFIG.SYS files written for other DOS systems. DEVICE NAMES DR DOS recognizes several special device names that can be used in place of filenames. These names are reserved and cannot be used for regular files. CON Console (keyboard input, screen output) NUL Null device (discards all output, returns empty on input) AUX Auxiliary device (the first serial port, same as COM1) PRN Printer (the first parallel port, same as LPT1) COM1-COM4 Serial ports 1 to 4 LPT1-LPT3 Parallel (printer) ports 1 to 3 Output sent to a printer or serial device goes to that port. For example: ECHO HELLO > LPT1 Print a line on the first printer COPY REPORT.TXT PRN Print a file TYPE FILE.TXT > COM2 Send a file to the second serial port Reading from a printer device returns nothing (end of file). The NUL Device: The NUL device is particularly useful for discarding unwanted output: DIR > NUL Run DIR but discard all output COPY FILE.TXT NUL Test if file can be read (output discarded) command > NUL Suppress output from any command In batch files, use IF EXIST NUL to test if device names are available (this always succeeds since NUL is a built-in device): IF EXIST NUL ECHO Device support available Device names are recognized in any directory context. You cannot create a file named NUL, CON, AUX, PRN, COM1-COM4 or LPT1-LPT3. EXPANDED MEMORY (EMS) DR DOS includes EMM386.SYS, an expanded memory manager that provides access to memory beyond the 640KB conventional memory limit. What is EMS? Expanded Memory Specification (EMS) is a standard for accessing additional memory on DOS systems. EMS memory is accessed through a 64KB "page frame" window in the upper memory area, with 16KB pages that can be mapped in and out as needed. DR DOS EMS Features: - EMS 4.0 support - Page frame at segment D000h (standard location) - Four 16KB physical pages (64KB page frame) - Up to 32MB of expanded memory (limited by available XMS) - 255 EMS handles maximum - Uses XMS memory as backing store - VCPI support for DOS extenders Enabling EMS - EMM386.SYS: EMS requires loading the EMM386.SYS driver via CONFIG.SYS: DEVICE=C:\EMM386.SYS Create or edit C:\CONFIG.SYS to include this line, then reboot. Without EMM386.SYS loaded, EMS is not available and programs that require expanded memory will report no EMS present. Checking EMS Availability: Use MEM to see expanded memory status: C:\>MEM /M The memory map (/M switch) shows EMS page frame regions. Extended memory shown in the basic MEM summary reflects XMS, which serves as the backing store for EMS pages. Programs that Support EMS: Many DOS applications can use EMS for additional memory: - Spreadsheets (Lotus 1-2-3, Quattro Pro) - Databases (dBASE, Paradox) - Word processors (WordPerfect) - Games (many titles from the late 1980s/1990s) - RAM disks and disk caches Consult each program's documentation for EMS configuration options. ANSI CONSOLE DRIVER (ANSI.SYS) DR DOS includes ANSI.SYS, a loadable device driver that adds support for ANSI/VT100 escape sequences in console output. Programs can use escape sequences to position the cursor, set text colors, clear the screen, and perform other display operations without using direct BIOS calls. Enabling ANSI.SYS: Load the driver via CONFIG.SYS: DEVICE=ANSI.SYS Create or edit C:\CONFIG.SYS to include this line, then reboot. Supported Escape Sequences: ANSI.SYS recognizes the following ESC[ sequences (ESC = character 27): Cursor Movement: ESC[nA Move cursor up n rows (default 1) ESC[nB Move cursor down n rows (default 1) ESC[nC Move cursor forward n columns (default 1) ESC[nD Move cursor backward n columns (default 1) ESC[r;cH Move cursor to row r, column c (1-based) Cursor Save/Restore: ESC[s Save current cursor position ESC[u Restore saved cursor position Screen Control: ESC[2J Clear entire screen and home cursor ESC[K Erase from cursor to end of line Text Attributes (SGR): ESC[0m Reset all attributes to default ESC[1m Bold (high intensity) ESC[5m Blinking text ESC[7m Reverse video ESC[30-37m Set foreground color ESC[40-47m Set background color Color Values: 30/40 = Black 34/44 = Blue 31/41 = Red 35/45 = Magenta 32/42 = Green 36/46 = Cyan 33/43 = Yellow 37/47 = White Multiple attributes can be combined: ESC[1;31;40m (bold red on black) Without ANSI.SYS loaded, escape sequences are not interpreted and appear as literal characters on screen. CD-ROM DRIVES (ATAPICD.SYS AND CDEX) DR DOS reads ISO 9660 discs in an IDE/ATAPI CD-ROM drive. Two files do the work, and both are installed on the hard disk image and by INSTALL: ATAPICD.SYS in C:\ The device driver. It talks to the drive. CDEX.EXE in C:\DOS\ The CD-ROM extension. It reads the disc and gives it a drive letter. Setting it up: Add this line to C:\CONFIG.SYS and reboot: DEVICE=C:\ATAPICD.SYS /D:MSCD001 Then run this command once, at the prompt or from AUTOEXEC.BAT: C:\DOS\CDEX /D:MSCD001 /L:E At boot the driver prints its name and the drive it found, for example: DR DOS 9.0 ATAPI CD-ROM Driver v1.0 Copyright (c) 2022-2026 Whitehorn Ltd. Co. Secondary IDE channel, first drive: Device MSCD001 installed. CDEX prints its name and the drive letter it assigned: DR DOS 9.0 CD-ROM Extension v1.0 Copyright (c) 2022-2026 Whitehorn Ltd. Co. Drive E: assigned to device MSCD001 - extension installed. With two CD-ROM drives the driver names each one before the last line, and CDEX assigns a letter to each, for example (with LASTDRIVE=F or higher in CONFIG.SYS): Secondary IDE channel, first drive: Secondary IDE channel, second drive: Device MSCD001 installed. Drive E: assigned to device MSCD001 - extension installed. Drive F: assigned to device MSCD001 - extension installed. From then on E: is the CD-ROM drive. DIR, TYPE, COPY from it, CD, and running programs and batch files from it work as on a hard disk; the differences are described below. The drive is read-only. Creating, deleting or renaming files and directories, and changing attributes, are refused. So is appending to a file on it (ECHO X >> E:\README.TXT prints "Access denied"). A disc that also has music tracks (a mixed-mode disc) works the same way: E: shows the files of its first track. The driver also plays music tracks for a CD player program, through the drive's own audio output. To copy the files of a disc to your hard disk, make a directory for them and give COPY a wildcard: MD C:\GAMES COPY E:\*.* C:\GAMES\ COPY copies the files of one directory, without its subdirectories: COPY E:\SUB\*.* C:\GAMES\ copies the files of E:\SUB. Names on the disc: The drive shows the names on the disc in 8.3 form. Files and directories that the disc marks as hidden have the hidden attribute. The device name (/D:): The name is 1 to 8 characters, in upper or lower case. The two lines must use the same name: the driver gives the name to the device, and CDEX looks for a CD-ROM driver of that name. MSCD001 is the usual choice. The channel to search (/P:): Without /P: the driver searches the standard IDE channels and uses up to four CD-ROM drives it finds. For a drive on an add-in controller or a sound card, name its channel: DEVICE=C:\ATAPICD.SYS /D:MSCD001 /P:port[,irq[,ctl]] port The base port of the channel in hexadecimal, for example /P:1E8. irq The interrupt number of the channel, in decimal. ctl The control port in hexadecimal. Give it only when the documentation of the card names one. With /P: only that channel is searched. A Plug and Play sound card must be set up by its own setup program before the driver loads. When the driver does not install, it prints one of these messages: ATAPICD: /D:name missing or invalid, driver not installed ATAPICD: no ATAPI CD-ROM drive found, driver not installed CDEX switches: The CDEX command in Chapter 7 lists the switches: /D: (required), /L: (the drive letter) and /M: (the number of sector buffers). Memory: CDEX keeps as many of the /M: buffers as fit in the memory it is given, and at least one. LH CDEX /D:MSCD001 loads it into upper memory when a block there can hold it with one buffer, and into conventional memory otherwise. When there is not room for even one buffer, CDEX is not loaded. The drive letter: CDEX uses the larger of the letter you ask for with /L: and the first letter after the drives already in use: A: and B:, the hard disk partitions, and the drives of block device drivers loaded from CONFIG.SYS. With C: as the only hard disk partition that is D:, and E: when there is also a D:. The letter must be within LASTDRIVE, which is E by default. If the letter would be past LASTDRIVE, CDEX says so and does not install. Put a higher value in CONFIG.SYS and reboot, for example: LASTDRIVE=Z so that CDEX /D:MSCD001 /L:F installs the disc on F:. Several drives: A driver that serves more than one CD-ROM drive (ATAPICD.SYS finds up to four) gives each drive a letter of its own. CDEX assigns them in order, the first drive on the letter chosen as above and the others on the letters after it, and prints one "Drive X: assigned" line for each. Every letter must be within LASTDRIVE, or CDEX installs none of them and prints the "No drive letter available" message. With two drives and the default LASTDRIVE (E), CDEX /D:MSCD001 gives D: and E: (with C: as the only hard disk partition), but CDEX /D:MSCD001 /L:E has no room for the second drive and installs nothing; use LASTDRIVE=Z in CONFIG.SYS, or leave /L: out. Each drive has its own disc, current directory and volume information; changing the disc in one drive does not change the others. Run CDEX once per boot. A second run does not install again; it prints "CD-ROM extension already installed". CDEX messages and exit codes: After its name and copyright line, CDEX prints one of the following: Exit code 0, installed: Drive E: assigned to device MSCD001 - extension installed. Exit code 87, the command line is wrong (both lines are printed): Invalid command line, CD-ROM extension not installed Syntax: CDEX /D:device [/L:letter] [/M:buffers] [/E] [/K] [/S] [/V] Exit code 87, /D: given twice: Only one /D: device is supported, CD-ROM extension not installed Exit code 5, refused: CD-ROM device MSCD001 not found, CD-ROM extension not installed No CD-ROM device given, CD-ROM extension not installed CD-ROM extension already installed No drive letter available for the CD-ROM, CD-ROM extension not installed Exit code 8, less memory than one sector buffer needs: Not enough memory, CD-ROM extension not installed "CD-ROM device ... not found" shows the name you gave. It is also the answer when the device of that name is not a CD-ROM driver. An empty drive: A disc that is still spinning up is waited for, up to about 15 seconds, before the prompt below appears. A drive that has stopped its disc is started by the next command that reads it, and the command then goes on without a prompt. With no disc in the drive, or the tray open, a command that reads the drive shows the prompt Not ready error reading drive E Abort, Retry, Fail ? Put the disc in and press R to go on. F ends the command with "Physical Media Error" and A ends it. A disc that is not an ISO 9660 disc shows "Bad media type reading drive E" and the same prompt. Changing the disc: After a disc change the drive goes back to the root directory of the new disc the next time a command opens a file, lists a directory or changes directory on it. See the CDEX command in Chapter 7. EXTENDED MEMORY (XMS) DR DOS includes a built-in XMS 2.0 compatible extended memory driver, providing access to memory above the 1MB boundary on 386 and higher processors. What is XMS? Extended Memory Specification (XMS) is a standard for accessing memory above 1MB in real mode. Unlike EMS which uses page mapping, XMS provides direct access to extended memory through block move operations. DR DOS XMS Features: - XMS 2.0 compatible - Automatic detection of available extended memory - Up to 32 simultaneous memory handles - High Memory Area (HMA) support for kernel - Used as backing store for EMS driver XMS is available automatically on systems with extended memory. No configuration or drivers are required. Checking XMS Availability: Use MEM to see extended memory status: C:\>MEM The memory summary will show XMS memory if available. High Memory Area (HMA): The HMA is the first 64KB of extended memory (minus 16 bytes). DR DOS loads part of its kernel into the HMA, freeing conventional memory for applications. The HMA is managed automatically by the system. Programs that Use XMS: Many DOS applications and extenders use XMS: - DOS extenders (DOS4GW, PMODE, etc.) - Disk caches - RAM disks - Large applications (compilers, CAD programs) CTRL-C AND BREAK Pressing Ctrl-C during keyboard input aborts the current program and returns to the command prompt. DR DOS displays "^C" on the screen when Ctrl-C is detected. With BREAK=ON in CONFIG.SYS, DR DOS also checks for Ctrl-C during other operations, such as long file copies, so that they can be stopped too. DISK ERROR HANDLING When a disk read or write fails, DR DOS retries the operation up to three times. If all retries are exhausted, the system asks what to do, as described below. An error from a device driver loaded with DEVICE= is reported at once, without retries. For example, DIR A: with no disk in drive A: shows I/O error reading drive A Abort, Retry, Fail ? The first line names the error, whether the program was reading or writing, and the drive or device. The second line lists the choices the operation allows. Press the first letter of a choice. Ctrl-C also means Abort. A (Abort) Ends the command or program. A program ended by Abort leaves ERRORLEVEL 0. R (Retry) Tries the operation again. If it fails again the message is shown again. I (Ignore) Goes on as if the operation had worked. F (Fail) The operation returns an error to the command, which reports it. A command that reads a drive with no disk in it reports "Physical Media Error", and a drive change leaves the current drive as it was. While a program is looked for along the PATH, a directory on such a drive is skipped with "Search path contains invalid drive". In a batch file, a command ended by Abort is followed by Halt Batch Process (Y/N) ? Press N to go on with the next line of the batch file. Any other key ends the batch file at once, including every batch file that called it. CHANGING DRIVES You can change the current drive by typing the drive letter followed by a colon: Syntax: drive: Examples: A: Switch to floppy drive A: B: Switch to floppy drive B: (same physical drive as A: on single-floppy systems) C: Switch to drive C: D: Switch to drive D: The command prompt will update to show the new current drive. Each drive maintains its own current directory, so switching back to a drive returns you to the directory you were in on that drive. Switching to a CD-ROM drive that holds no disc shows the critical error prompt "Abort, Retry, Fail ?". Press F and the message "Physical Media Error" appears; you stay on the current drive. Insert a disc and press R and the switch to the CD-ROM drive is made. When the disc has been changed, the switch returns the CD-ROM drive to the root directory of the new disc. CLEARING THE SCREEN Use the CLS command to clear the screen and position the cursor at the top-left corner. Syntax: CLS NOTE: CLS is an external command. The file CLS.COM must be in the current directory or in a directory on your PATH (C:\DOS\ by default). =============================================================================== CHAPTER 7: COMMAND REFERENCE =============================================================================== This chapter describes all available DR DOS commands in alphabetical order. ------------------------------------------------------------------------------- ATTRIB - Display or Change File Attributes ------------------------------------------------------------------------------- Displays or modifies file attributes (read-only, hidden, system, archive). Syntax: ATTRIB [+R|-R] [+A|-A] [+H|-H] [+S|-S] [filespec] [/S] Parameters: +R or -R Set or clear read-only attribute +A or -A Set or clear archive attribute +H or -H Set or clear hidden attribute +S or -S Set or clear system attribute filespec File or pattern to act on (default: *.*) /S Process files in subdirectories recursively Examples: ATTRIB Display attributes of all files in current directory ATTRIB *.TXT Display attributes of all .TXT files ATTRIB +R FILE.TXT Set read-only on FILE.TXT ATTRIB -R FILE.TXT Clear read-only on FILE.TXT ATTRIB +H +S FILE Set both hidden and system attributes ATTRIB +R+H+S+A F Set all four attributes (concatenated form) ATTRIB *.* /S Display attributes of all files recursively Notes: - ATTRIB is an external command; ATTRIB.EXE must be available. - Without +/- flags, ATTRIB displays the current attributes of each matching file. With +/- flags, it modifies the attributes and displays the resulting state. - Each file is shown with its attributes as letters (r read-only, s system, a archive, h hidden) followed by its path. - Multiple +/- flags may be given as separate tokens (+R +H) or concatenated within a single token (+R+H+S+A). - Attempting to both set and clear the same attribute in one command (e.g. +R -R) is rejected with an error, and no attributes are changed. - The - prefix always means "clear attribute", never a command switch. Only / introduces switches (/S, /?, /H). - To delete a read-only file, first clear its read-only attribute with ATTRIB -R, then use DEL. Related commands: DEL, DIR ------------------------------------------------------------------------------- BATCH - Batch File Interpreter ------------------------------------------------------------------------------- Executes batch file (.BAT) scripts. This command is invoked automatically by COMMAND.COM when you run a .BAT file; you do not normally run it directly. Syntax: BATCH filename [parameters] Parameters: filename The batch file to execute parameters Optional parameters passed to the batch file as %1-%9 Supported Batch Commands: Flow Control: REM Comment (ignored) ECHO Display text or control echoing PAUSE Wait for keypress GOTO Jump to label (including GOTO :EOF to exit) :label Label definition CALL Execute another batch file and return @ Suppress echo for current line Conditionals: IF EXIST Test if file exists IF ERRORLEVEL Test program exit code IF "str"=="str" Compare strings IF NOT Negate any condition File Operations: COPY Copy files DEL/ERASE Delete files REN/RENAME Rename files and directories MD/MKDIR Create directories RD/RMDIR Remove directories CD/CHDIR Change directory Variables: SET Display or modify environment variables %0-%9 Parameter substitution %VARNAME% Environment variable expansion SHIFT Shift parameters left Redirection and Piping: cmd > file Redirect output to file cmd >> file Append output to file cmd < file Redirect input from file cmd1 | cmd2 Pipe output to another command Examples: BATCH CLEANUP.BAT BATCH INSTALL.BAT C:\GAMES Notes: - BATCH is an external command; BATCH.COM must be available in a directory on your PATH (C:\DOS\ by default). - You typically run batch files by typing their name directly (e.g., CLEANUP or CLEANUP.BAT). COMMAND.COM automatically invokes BATCH.COM. - See Appendix B for complete batch programming documentation. Related commands: None ------------------------------------------------------------------------------- CD - Change Directory ------------------------------------------------------------------------------- Changes the current directory or displays the current directory path. Syntax: CD [drive:][path] Parameters: drive: The drive containing the directory (optional) path The directory to change to Examples: CD Display current directory CD \ Change to root directory CD .. Change to parent directory CD \DOS Change to \DOS directory CD SUBDIR Change to SUBDIR within current directory CD.. Change to parent (space optional) CD\ Change to root (space optional) CD D: Show D:'s current directory (does not switch to D:) CD D:\WORK Set D:'s current directory to \WORK (stays on C:) Notes: - CD and CHDIR are identical commands. - Spaces are optional when using .. or \ as the path. - To change drives, type the drive letter followed by a colon (for example, D:) and press ENTER. CD does not change drives. - CD followed by a drive letter and colon alone (CD D:) displays that drive's current directory and leaves your current drive and your current directory unchanged. - CD with a drive letter AND a path (CD D:\WORK) is different. It changes D:'s current directory but leaves you on your current drive. Type D: afterwards to switch to it. Related commands: DIR ------------------------------------------------------------------------------- CDEX - CD-ROM Extension ------------------------------------------------------------------------------- Connects the CD-ROM drives loaded by ATAPICD.SYS to drive letters, so that the discs can be used like any other drive. A driver that serves several drives gets a letter for each, in order. CDEX stays resident. Syntax: CDEX /D:device [/L:letter] [/M:buffers] Switches: /D:device Name given to the driver with DEVICE=ATAPICD.SYS /D:name (1 to 8 characters). Required, and only once. /L:letter Drive letter to use for the first drive; a value that is not a letter is ignored. The letter used is the larger of this one and the first letter after the drives in use; the other drives of the driver take the letters after it. /M:buffers Number of 2 KB sector buffers, 1 to 16 (default 4); fewer if they do not fit in the memory CDEX is given. CDEX reads up to that many sectors of a file ahead, so more buffers make small reads faster. Examples: CDEX /D:MSCD001 /L:E Make the CD-ROM drive E: CDEX /D:MSCD001 /L:E /M:8 The same, with eight sector buffers Exit codes: 0 Installed; the line "Drive E: assigned to device MSCD001 - extension installed." is printed under the banner, one line for each drive 5 Refused: the device is not found or is not a CD-ROM driver, no /D:, already installed, or the drives do not all get a drive letter within LASTDRIVE (then none is installed) 8 Less memory than one sector buffer needs (not enough memory) 87 Command line error (also CDEX alone), or /D: given twice Notes: - Load the driver first: DEVICE=C:\ATAPICD.SYS /D:MSCD001 in CONFIG.SYS. - LH CDEX /D:MSCD001 goes into upper memory when a block there holds CDEX with one buffer, and keeps as many /M: buffers as fit in it. Without LH it keeps them all if conventional memory allows. When memory cannot hold CDEX with one buffer, DOS does not start it. - Run CDEX once per boot; a second run prints "CD-ROM extension already installed" and exits with 5. - With no disc in the drive, a command that reads it shows "Not ready error reading drive E" and "Abort, Retry, Fail ?"; insert the disc and press R. - See "CD-ROM DRIVES (ATAPICD.SYS AND CDEX)" in Chapter 6 for the complete list of messages and for LASTDRIVE. Related commands: DIR, TYPE ------------------------------------------------------------------------------- CHDIR - Change Directory ------------------------------------------------------------------------------- Identical to CD. See CD for details. ------------------------------------------------------------------------------- COMMAND - Command Interpreter ------------------------------------------------------------------------------- COMMAND.COM is the DR DOS command interpreter. It displays the prompt, executes built-in commands, and launches external programs. Normally it runs as the system shell (loaded at boot or via SHELL= in CONFIG.SYS), but it can also be invoked with the /C switch to run a single command and exit. Syntax: COMMAND [/C command] Switches: /C command Execute the specified command and exit immediately. The exit code (ERRORLEVEL) of the child command is returned as COMMAND.COM's own exit code. The /C switch supports the full command-line syntax: built-in commands, external programs, batch files, pipes (|), output redirection (>, >>), and input redirection (<). Environment variables (%VAR%) are expanded before execution. Examples: COMMAND /C DIR Run DIR and exit COMMAND /C DIR | MORE Run a pipeline and exit COMMAND /C ECHO %PATH% Expand variable and echo it COMMAND /C MYPROG.EXE Run a program and exit Notes: - /C is case-insensitive (/c works the same as /C). - The entire remainder of the command line after /C is treated as the command to execute. No quoting is needed. - The child command's exit code becomes COMMAND.COM's exit code, so IF ERRORLEVEL works as expected after COMMAND /C in a batch file. - %VAR% substitution occurs before dispatch: undefined variables expand to empty strings, and %% produces a literal %. - The child process inherits COMMAND.COM's environment but changes made by the child do not propagate back to the caller. Related commands: BATCH, SET ------------------------------------------------------------------------------- CLS - Clear Screen ------------------------------------------------------------------------------- Clears the screen and positions the cursor at the top-left corner. Syntax: CLS Parameters: None Examples: CLS Notes: - CLS is an external command; CLS.COM must be available in the current directory or in a directory on your PATH (C:\DOS\ by default). Related commands: None ------------------------------------------------------------------------------- COPY - Copy Files ------------------------------------------------------------------------------- Copies a file, or every file that matches a wildcard, from one location to another. Syntax: COPY source [destination] Parameters: source The file or files to copy; * and ? stand for any characters and any one character destination The name of the new file, or a directory or drive that receives a file with the source's name, or a name with * or ? that renames the files; the current directory when left out Examples: COPY README.TXT README.BAK COPY D:DATA.TXT C:\BACKUP\DATA.TXT COPY LETTER.DOC D:LETTER.DOC COPY LETTER.DOC D: COPY C:\DOCS\*.TXT D:\BACKUP\ COPY *.TXT *.BAK COPY E:\*.* C:\GAMES\ Notes: - A source with * or ? in it names every matching file. COPY prints the name of each file as it copies it and ends with the number of files copied. Directories, hidden files and system files are not copied; read-only files are, and the copies are not read-only. If nothing matches, COPY prints the source, "File not found" and a count of 0. If the directory of the source does not exist, the message is "Invalid directory specified". - A destination that ends in a backslash, is a drive letter and colon (D:), or names an existing directory is a directory: each file is copied into it under its own name. COPY LETTER.DOC D: makes LETTER.DOC in the current directory of D:. If the directory does not exist, COPY prints "Invalid directory specified" and copies nothing; so it does for a file name in a directory that does not exist (COPY A.TXT C:\NOSUCH\B.TXT). - A destination with * or ? in its last part renames the files as REN does: a ? keeps the character of the source name, a * keeps the rest of it, and any other character replaces it. Files that get the same name overwrite each other. - With a wildcard source, a destination that is neither a directory nor a pattern receives all the files joined into one text file: each file is read up to its first Ctrl-Z, and the count is 1. If the destination is itself one of the matching files, the others are added to its end when it is found first; when it is found later, COPY prints "Destination file contents lost before copy" and leaves it out. - With no disk in the drive, or no disc in a CD-ROM drive, COPY shows the critical error prompt. Insert the disk and press R to go on. If you press F, COPY prints "Physical Media Error" and copies nothing. - COPY stops at the first error. - If the destination file already exists, it is overwritten without warning. A read-only destination file is never overwritten: COPY prints "Access denied" and "0 file(s) copied", and the file is not changed. - If the source and destination resolve to the same file, COPY refuses with "Source and Destination cannot be the same file" and reports "0 file(s) copied". The file is not modified. - COPY CON filename creates a file from what you type. Type the text, then press Ctrl-Z followed by ENTER on a line of its own to finish. - Names longer than 66 characters are refused with "Filename too long" (see Appendix A). Related commands: MOVE ------------------------------------------------------------------------------- DATE - Display or Set Date ------------------------------------------------------------------------------- Displays the current system date or sets a new date. Syntax: DATE [mm-dd-yyyy] Parameters: mm-dd-yyyy Optional new date (month-day-year) Examples: DATE Display current date and prompt for new date DATE 12-25-2025 Set date to December 25, 2025 DATE 01/15/2026 Set date to January 15, 2026 Notes: - DATE is an external command; DATE.COM must be available. - When called without parameters, DATE displays the current date with day-of-week and prompts for a new date. - Date format is flexible: use -, /, or other delimiters. - Two-digit years are interpreted as: 80-99 = 19xx, 00-79 = 20xx - Valid year range: 1980-2099 - Press ENTER at the date prompt to keep the current date. Related commands: None ------------------------------------------------------------------------------- DEL - Delete File ------------------------------------------------------------------------------- Deletes one or more files from the disk. Syntax: DEL filename ERASE filename Parameters: filename The file to delete (may include wildcards) Examples: DEL LETTER.TXT ERASE REPORT.DOC DEL *.BAK Notes: - DEL and ERASE are identical commands. - Wildcard characters are supported. - The file cannot be read-only; it must have its read-only attribute cleared first. - Deleting every file in a directory (DEL *.*) asks "Are you sure (Y/N) ?" first. Type Y and press Enter to confirm; any other answer cancels. - Naming a directory (DEL dir) deletes all the files in it, after the same question. The directory itself is not removed. - If no files match (empty directory or nonexistent pattern), DEL prints "File not found" without prompting. - Names longer than 66 characters are refused with "Filename too long" (see Appendix A). Related commands: COPY, RD ------------------------------------------------------------------------------- DIR - Directory Listing ------------------------------------------------------------------------------- Displays a list of files and subdirectories in a directory. Syntax: DIR [drive:][path][filespec] [/W] Parameters: drive: The drive to list (optional) path The directory to list (optional) filespec File specification, may include wildcards (optional) Switches: /W Wide format (5 columns, filenames only) Examples: DIR List current directory DIR *.TXT List all .TXT files DIR /W List files in wide format DIR D: List files on drive D: DIR \DOS List files in \DOS directory DIR \DOS\ Same as DIR \DOS DIR .. List the parent of the current directory DIR C:\*.COM List all .COM files in root of C: Output: The listing shows: - Volume label (if any) - Volume serial number (if the disk has one, shown as XXXX-XXXX) - Directory path: the directory being listed - File names, sizes, dates (MM-DD-YY), and times (H:MMa/p) - Subdirectories (marked with ) - Total number of files and bytes With /W switch, only file names are shown in a compact 5-column format without size, date, or time information. Notes: - DIR is an external command; DIR.COM must be available in the current directory or in a directory on your PATH (C:\DOS\ by default). Related commands: CD ------------------------------------------------------------------------------- EDIT - Full-Screen Text Editor ------------------------------------------------------------------------------- Opens a full-screen text editor for creating and editing text files. Syntax: EDIT [filename] Parameters: filename Optional file to open for editing Screen Layout: The editor uses a colored display: - Top row: Menu bar (File, Edit, Search) and current filename - Middle rows: Text editing area (white text on blue background) - Bottom row: Status bar showing line number, column, and modified indicator Menu Access: Alt+F Open File menu (New, Open, Save, Save As, Exit) Alt+E Open Edit menu (Cut, Copy, Paste) Alt+S Open Search menu (Find, Find Next) Navigate menus with arrow keys. Press Enter to select an item or Escape to close the menu. Keyboard Shortcuts: Ctrl+N New file Ctrl+O Open file Ctrl+S Save file Ctrl+F Find F3 Find Next (repeat last search) Ctrl+X Cut line Ctrl+C Copy line Ctrl+V Paste Alt+X Exit editor Navigation: Arrow keys Move cursor Home Move to beginning of line End Move to end of line Page Up Scroll up one page Page Down Scroll down one page Ctrl+Home Move to beginning of file Ctrl+End Move to end of file Editing: Backspace Delete character before cursor Delete Delete character at cursor Enter Insert new line Tab Insert spaces to next tab stop Clipboard Operations (Edit menu): Cut Copy current line to clipboard and delete it Copy Copy current line to clipboard Paste Insert clipboard contents at cursor Examples: EDIT Open editor with empty file EDIT README.TXT Open README.TXT for editing EDIT NEWFILE.TXT Create and edit a new file Notes: - EDIT is an external command; EDIT.COM must be available in the current directory or in a directory on your PATH (C:\DOS\ by default). - Maximum file size is limited by available conventional memory. - Files are saved with CR+LF line endings. - Lines longer than 80 characters are truncated on display. - A read-only file can be opened and edited, but not saved over. When a save fails (Ctrl+S, Save, or Save As), EDIT shows "File error. Press any key." and keeps the text; the file and its read-only attribute are unchanged. When the save was the answer to a "Save changes?" question (Alt+X, File/New or File/Open), the editor stays open with the text, as it does when Save As is cancelled with Esc. Use Save As with another name to keep the text. Related commands: TYPE, MORE ------------------------------------------------------------------------------- ECHO - Display Message ------------------------------------------------------------------------------- Displays a message, prints a blank line, or controls command echoing. Syntax: ECHO message ECHO. ECHO ECHO ON ECHO OFF Parameters: message Text to display on screen ON Enable command echoing (commands are displayed before execution) OFF Disable command echoing (commands execute silently) Examples: ECHO Hello, World! Display "Hello, World!" ECHO. Display a blank line ECHO Display current echo state (ECHO is on/off) ECHO OFF Suppress command display Notes: - ECHO is a built-in command, always available. - ECHO. (period immediately after ECHO, no space) prints a blank line. - ECHO ON/OFF controls whether commands are displayed before execution. This is primarily useful in batch files; at the interactive prompt, commands are not echoed regardless of the setting. - ECHO with no arguments displays the current echo state. Related commands: None ------------------------------------------------------------------------------- ERASE - Delete File ------------------------------------------------------------------------------- Identical to DEL. See DEL for details. ------------------------------------------------------------------------------- EXIT - Exit Command Interpreter ------------------------------------------------------------------------------- Terminates the command interpreter (COMMAND.COM). Syntax: EXIT Parameters: None Notes: - If COMMAND.COM was started by another program, EXIT returns to that program. ------------------------------------------------------------------------------- FDISK - Fixed Disk Setup Program ------------------------------------------------------------------------------- Partitions hard disks with MBR partition tables. Creates, deletes, and manages primary DOS partitions. Syntax: FDISK FDISK /STATUS FDISK /AUTO n FDISK /MBR Switches: /STATUS Display partition table without modification /AUTO n Non-interactive: create a partition on hard disk n (1 = first hard disk, 2 = second, etc.) and replace that disk's partition table without asking. If n is missing, is not a single digit or names no hard disk, FDISK prints its usage text. If the disk holds a FAT32 or other non-FAT partition, FDISK shows the partition table and "Operation cancelled." and writes nothing. /MBR Rewrite MBR bootstrap code, preserving the existing partition table If the system has no fixed disk, FDISK prints "No fixed disk drives detected." and exits with errorlevel 1. FDISK /? still prints the usage. Exit codes: 0 The menu was left with Esc, /STATUS displayed the partition table, /AUTO n or /MBR completed, or /? or /H printed the usage 1 The system has no fixed disk; the /AUTO drive number is missing, malformed or names no disk; /AUTO n refused to replace a FAT32 or other non-FAT partition; or reading the disk geometry, reading, writing or verifying a disk failed in /STATUS, /AUTO n or /MBR Interactive Mode: When run without switches, FDISK presents a menu: 1. Create DOS partition 2. Set active partition 3. Delete DOS partition 4. Display partition information 5. Change current fixed disk drive Use option 1 to create a new partition, option 2 to mark a partition as bootable, and option 4 to review the current layout. On systems with multiple hard disks, use option 5 to switch between drives. Option 1 replaces the whole partition table. If the disk holds a FAT32 or other non-FAT partition, including a logical drive in an extended partition, option 1 shows the partition table, prints "Operation cancelled." and returns to the menu without asking anything. Delete that partition with option 3 first. /MBR keeps the partition table, and /STATUS and option 4 show such entries by type: FAT32 (0Bh), FAT32 (0Ch), or Type nnh for any other type number. Partition Types: FDISK automatically selects the correct partition type based on partition size and disk geometry: FAT12 (type 01h) Partitions up to 16 MB FAT16 (type 04h) Partitions up to 32 MB FAT16B (type 06h) Partitions up to 2 GB (CHS-addressable) FAT16 (type 0Eh) Partitions requiring LBA addressing Examples: FDISK Start interactive partitioning FDISK /STATUS Display current partition table FDISK /AUTO 1 Create partition on first hard disk FDISK /MBR Rewrite MBR bootstrap code Notes: - FDISK is an external command; FDISK.COM must be available in the current directory or in a directory on your PATH (C:\DOS\ by default). - After creating or deleting partitions, reboot before using the modified disk. - Use FORMAT to create a filesystem on a newly partitioned drive. Creating a partition also clears its first sector, so a file system that was there before is gone and FORMAT can format the new partition. WARNING: Deleting a partition destroys all data on that partition. Related commands: FORMAT ------------------------------------------------------------------------------- FORMAT - Format Disk ------------------------------------------------------------------------------- Creates FAT12 or FAT16 filesystems on partitioned hard disk drives. Writes the volume boot record, FAT tables, and root directory. Syntax: FORMAT drive: [/Q] [/V] [/S] Parameters: drive: The drive letter to format (e.g., C: or D:) Switches: /Q Quick format. Clears the FAT and root directory without performing a surface verification of the disk. /V Prompt for a volume label after formatting. /S System. Transfer system files after formatting, making the disk bootable. Copies DRBIOS.SYS, DRDOS.SYS, and COMMAND.COM to the formatted drive. Examples: FORMAT D: Format drive D: FORMAT D: /Q Quick format drive D: FORMAT D: /V Format and prompt for volume label FORMAT D: /S Format and make bootable FORMAT D: /Q /S /V Quick format, make bootable, set label Output: FORMAT displays a confirmation prompt before proceeding, then shows progress during formatting. On completion, it reports: - Total disk space - Bytes available on disk - Bytes per allocation unit - Number of allocation units - Volume serial number Notes: - FORMAT is an external command; FORMAT.COM must be available in the current directory or in a directory on your PATH (C:\DOS\ by default). - The target drive must already have a partition (see FDISK). - FORMAT cannot format a network drive or a CD-ROM drive (a drive that network software or a CD-ROM extension such as CDEX provides). It prints "Cannot use FORMAT on a NETWORK,ASSIGNed or SUBSTed drive" and exits with errorlevel 2; nothing is written. - FORMAT formats the FAT12 or FAT16 partition, primary or logical, that the drive letter refers to, on any hard disk. It refuses, and writes nothing, when the letter is not a hard disk partition (a RAM disk or other device driver's drive, or a drive that does not exist), when the disk has no partition table, and when the partition is FAT32 or of another type. - FORMAT writes FAT12 on a partition of type 01h and FAT16 on a partition of any other FAT type. - The /S switch requires DRBIOS.SYS, DRDOS.SYS, and COMMAND.COM to be available on the current drive. - FORMAT refuses to format the boot drive or the current drive and reports an error. - At the confirmation prompt, press Y to format or N to cancel; other keys are ignored and the prompt is shown again. (On the German-language build the keys are J and N.) Keys typed before the prompt appears are discarded. - FORMAT returns an exit code (ERRORLEVEL): 0 on success; 1 if you decline the confirmation prompt or the drive is not a single FAT12 or FAT16 partition; 2 for a network or CD-ROM drive; 4 if the drive is not a hard disk partition, the partition table is missing or unreadable, or formatting fails; 5 for the boot drive or the current drive. WARNING: Formatting a drive destroys all data on that drive. FORMAT will prompt for confirmation before proceeding. Related commands: FDISK ------------------------------------------------------------------------------- HEXDUMP - Display Hex Dump ------------------------------------------------------------------------------- Displays a hexadecimal dump of a binary file. Syntax: HEXDUMP filename Parameters: filename The file to display Examples: HEXDUMP COMMAND.COM HEXDUMP PROGRAM.EXE Output: Each line shows: - Hexadecimal offset from start of file - 16 bytes in hexadecimal format - ASCII representation (non-printable characters shown as ".") Notes: - HEXDUMP is an external command; HEXDUMP.COM must be available. - Handles files larger than 64KB. - Useful for examining binary files, debugging, and data recovery. Related commands: TYPE ------------------------------------------------------------------------------- JMP - Execute Code at Memory Address ------------------------------------------------------------------------------- Performs a far call to a flat 20-bit real-mode memory address, transferring CPU execution to whatever code lives there. Completes the PEEK/POKE/JMP trio for direct memory manipulation. The target address is called (not jumped to), meaning code at that address can return to DOS cleanly by executing a far return (RETF instruction). If the target code never returns (because it jumps elsewhere, resets the machine, or calls INT 20h), JMP.COM never returns either. Syntax: JMP address Parameters: address Flat memory address in hex with h suffix, up to 5 digits. Range: 0h to FFFFFh. Examples: JMP FFFF0h Call the BIOS reset vector (resets the machine) JMP 100h Execute code at 0010:0000 Entry state seen by called code: CS:IP = target address SS:SP = JMP.COM stack; return address on top (use RETF to return) DS,ES = JMP.COM data segment Registers AX-DI: undefined Notes: - JMP is an external command; JMP.COM must be available in the current directory or in a directory on your PATH (C:\DOS\ by default). - The primary workflow is: use POKE to write machine code into a scratch area of RAM, then use JMP to execute it. This gives you an inline code execution capability from the command line. - JMP FFFF0h resets the machine: it calls the BIOS reset entry point, the same one the CPU starts at on power-on. - If called code returns via RETF, JMP.COM exits to DOS normally. If called code calls INT 20h or INT 21h AH=4Ch, the process terminates and DOS gets control back either way. WARNING: Jumping to an address that contains garbage or random data will crash the system immediately. Always know what is at an address before jumping to it. Use PEEK and HEXDUMP to inspect memory first. Related commands: PEEK, POKE ------------------------------------------------------------------------------- KEYB - Keyboard Layout Driver ------------------------------------------------------------------------------- Loads a resident keyboard layout driver that remaps keystrokes from US QWERTY to a national keyboard layout. Currently supports German (QWERTZ). Syntax: KEYB code Parameters: code Two-letter country code: DE German QWERTZ layout GR Same as DE (alias) US Disable remapping (return to US QWERTY) Examples: KEYB DE Load the German QWERTZ keyboard layout. Letters Y and Z are swapped, and keys such as [, ;, ', and - produce German characters (umlauts, eszett) instead of their US equivalents. Number row shifted characters are also remapped to match a German keyboard (e.g., Shift+7 produces / instead of &). The 102nd key (next to the left Shift key) produces < and > (| with AltGr), the + and # keys produce + * and # ', and the right Alt key acts as AltGr: AltGr+Q @ AltGr+7 { AltGr+8 [ AltGr+9 ] AltGr+0 } AltGr+eszett \ AltGr++ ~ AltGr+2 (superscript 2) AltGr+3 (superscript 3) AltGr+M (micro sign) AltGr+102nd key | The left Alt key together with Ctrl gives the same characters (and additionally AltGr+u-umlaut key = [ and AltGr+caret key = \). With AltGr held, other character keys produce nothing; space, the function keys, Enter, the cursor keys and the keypad are not changed. KEYB US Disable the German layout and return to standard US QWERTY. The resident driver remains in memory but stops remapping keystrokes, and the right Alt key is an ordinary Alt key again. KEYB GR Same as KEYB DE. GR is accepted as a silent alias for DE. Output: KEYB DE prints a confirmation message and stays resident. KEYB US prints a confirmation and exits. KEYB with an unrecognized code prints "Bad parameter(s)" and exits with errorlevel 1. Notes: - KEYB is an external command; KEYB.COM must be available in the current directory or in a directory on your PATH (C:\DOS\ by default). - Caps Lock works as a Shift Lock: it shifts every key, including the number row, and pressing either Shift key turns it off. - Running KEYB DE again does not use more memory. Related commands: None ------------------------------------------------------------------------------- LOADHIGH - Load Program into Upper Memory ------------------------------------------------------------------------------- Loads a program into upper memory blocks (UMBs) when available, silently falling back to conventional memory otherwise. This is useful for loading TSRs and drivers into upper memory to conserve conventional memory. HILOAD, LOADHIGH and LH are the same command. Syntax: LOADHIGH program [arguments] LH program [arguments] HILOAD program [arguments] Parameters: program The program to load (.COM or .EXE) arguments Any arguments to pass to the program Examples: LOADHIGH MOUSE.COM LH KEYB.COM US HILOAD CDEX.EXE /D:MSCD001 Notes: - If no upper memory is available (EMM386 not loaded or DOS=UMB not set in CONFIG.SYS), the program loads into conventional memory without error. This allows batch files to use LOADHIGH unconditionally. - The program receives its arguments exactly as if run directly. - LOADHIGH of a program that is not found prints "Command or filename not recognized". - LOADHIGH, LH, and HILOAD are built-in commands available at the interactive prompt and in batch files. Related commands: MEM ------------------------------------------------------------------------------- MD - Make Directory ------------------------------------------------------------------------------- Creates a new directory. Syntax: MD dirname MKDIR dirname Parameters: dirname The name of the new directory Examples: MD DOCS MKDIR BACKUPS Notes: - MD and MKDIR are identical commands. - The parent directory must already exist. - If a directory with the same name already exists, MD will return an error instead of creating a duplicate entry. - Names longer than 66 characters are refused with "Filename too long" (see Appendix A). Related commands: CD, RD ------------------------------------------------------------------------------- MEM - Display Memory Information ------------------------------------------------------------------------------- Displays comprehensive system memory information. Syntax: MEM [switches] Switches: /H /? Display help text /B Show conventional memory blocks (MCB chain) /U Show upper memory blocks (UMB chain) /F Show HMA (High Memory Area) blocks /D Show device drivers /S Show system structures /M Show system memory map with ASCII visualization /A Show all information (combines all modes) /P Pause listing at each page (23 lines) Examples: MEM Display memory summary MEM /B Show conventional memory blocks MEM /M Show memory map with visualization MEM /A Show all available information MEM /A /P Show all information with paging Output: The default output shows a summary table with: - Conventional memory (0-640KB) - Upper memory (UMBs, A000-FFFF), shown when EMM386.SYS is loaded and DOS=HIGH,UMB is set in CONFIG.SYS. Use DEVICEHIGH= or LOADHIGH to load drivers and TSRs into upper memory blocks, freeing conventional memory. - High memory area (HMA) - Extended memory (XMS) - Total memory available Additional switches provide detailed block-by-block information including owner, size, and memory visualization. Notes: - MEM is an external command; MEM.COM must be available. - Switches can be combined (e.g., MEM /B /U /P) - The /M switch provides an ASCII art visualization of the entire memory map. - Very useful for diagnosing memory issues and understanding system configuration. Related commands: LOADHIGH ------------------------------------------------------------------------------- MORE - Display Output One Page at a Time ------------------------------------------------------------------------------- Displays a text file one page at a time, pausing after each screenful. Syntax: MORE [filename] MORE < filename command | MORE Parameters: filename The file to display (optional; if omitted, reads from standard input) Controls: Space Display next page (23 lines) Enter Display next line Q or Esc Quit Ctrl-C Quit Examples: MORE README.TXT MORE < README.TXT TYPE BIGFILE.TXT | MORE DIR | MORE MEM /A | MORE Notes: - MORE is an external command; MORE.COM must be available in the current directory or in a directory on your PATH (C:\DOS\ by default). - When used with piping (|), the output of the preceding command is displayed one page at a time. - The prompt "Strike a key when ready . . . " appears at the bottom of each page. Press Space (or any key other than ENTER, Q, Esc or Ctrl-C) for the next page, ENTER for one more line, or Q, Esc or Ctrl-C to quit. - Typed with no filename and no redirection, MORE reads what you type at the keyboard and shows each line again; press Ctrl-Z and then ENTER to end it, or Ctrl-C. - Use TYPE for quick viewing of short files; use MORE for long files. Related commands: TYPE ------------------------------------------------------------------------------- MOUSE - PS/2 Mouse Driver ------------------------------------------------------------------------------- Loads a resident PS/2 mouse driver that provides the standard INT 33h mouse API used by DOS applications and games. Syntax: MOUSE Parameters: None Examples: MOUSE Load the mouse driver before running applications that require mouse support (e.g., games, editors, menu-driven programs). Output: MOUSE starts by displaying its name and copyright line: DR DOS 9.0 PS/2 Mouse Driver v1.0 Copyright (c) 2022-2026 Whitehorn Ltd. Co. If a PS/2 mouse is detected, the driver installs itself as a Terminate-and-Stay-Resident (TSR) program and displays: Mouse detected - driver installed. If no PS/2 mouse is detected, or the mouse cannot be enabled, the driver displays No PS/2 mouse detected - driver not installed. and exits with errorlevel 1. Nothing stays in memory. Mouse Cursor: Applications control the mouse cursor through INT 33h calls. In text mode, the cursor appears as an inverse-video block character. Notes: - MOUSE is an external command; MOUSE.COM must be available in the current directory or in a directory on your PATH (C:\DOS\ by default). - A PS/2-compatible mouse (or emulation) is required. - Once loaded, the driver remains in memory. Reboot to unload. - Load MOUSE before starting any application that needs mouse input. Related commands: None ------------------------------------------------------------------------------- MKDIR - Make Directory ------------------------------------------------------------------------------- Identical to MD. See MD for details. ------------------------------------------------------------------------------- MOVE - Move Files ------------------------------------------------------------------------------- Moves a file from one location to another, removing the original. Syntax: MOVE source destination Parameters: source The file to move destination The target filename or directory Examples: MOVE OLD.TXT NEW.TXT MOVE C:\DOCS\FILE.TXT C:\BACKUP\ MOVE *.BAK C:\ARCHIVE\ Notes: - MOVE is an external command; MOVE.EXE must be available. - If the destination file exists, MOVE asks before overwriting it. Enter Y for yes, N for no, or A to overwrite all remaining files without asking. - A wildcard source moves files only; subdirectories stay where they are. - A wildcard in the file name of the destination is a pattern for the new names: MOVE *.TXT *.BAK renames every .TXT file to .BAK. - With a wildcard source, a destination that does not exist is created as a directory, together with any missing directories above it (MOVE *.TXT A\B\C creates A, B and C). - A drive letter alone as the destination, such as C:, is the current directory of that drive. - Between a CD-ROM or network drive and another drive, MOVE copies the file and then deletes the original. The copy keeps the date, time and attributes of the original. A file on a CD-ROM cannot be deleted, so the original stays there. - MOVE can rename a directory, as REN does. Related commands: COPY ------------------------------------------------------------------------------- PEEK - Read Byte from Memory Address ------------------------------------------------------------------------------- Reads a single byte from any flat real-mode memory address and displays it as two uppercase hex digits. Addresses span the full 20-bit real-mode address space (0h through FFFFFh), giving direct access to conventional memory, video RAM, the BIOS data area, and the interrupt vector table. Syntax: PEEK address Parameters: address Flat memory address in hex with h suffix (e.g. B8000h). Up to 5 hex digits. Range: 0h to FFFFFh. Examples: PEEK 0h Read first byte of interrupt vector table PEEK 46Ch Read low byte of BIOS timer tick counter PEEK B8000h Read first character byte of text video RAM PEEK A0000h Read first byte of VGA graphics framebuffer Output: A two-digit uppercase hex value followed by a newline: FF Notes: - PEEK is an external command; PEEK.COM must be available in the current directory or in a directory on your PATH (C:\DOS\ by default). - Addresses are entered in hexadecimal with an h suffix. No 0x prefix is used. Both uppercase and lowercase hex digits are accepted. - The full 1 MB real-mode address space is accessible. There is no memory protection; any address may be read. - See the PC memory map below for notable addresses. PC Memory Map (selected addresses): 0h - 3FFh Interrupt vector table (256 vectors x 4 bytes) 400h - 4FFh BIOS data area (equipment flags, cursor, etc.) 46Ch BIOS timer tick counter low word 472h Warm boot flag (1234h = warm boot) B8000h - BFFFFh CGA/VGA text mode video RAM A0000h - AFFFFh VGA graphics framebuffer (mode 13h, etc.) B0000h - B7FFFh Monochrome display adapter RAM C0000h - EFFFFh ROM space (video BIOS, adapter ROMs) F0000h - FFFFFh System BIOS ROM Related commands: POKE, JMP, HEXDUMP ------------------------------------------------------------------------------- POKE - Write Byte to Memory Address ------------------------------------------------------------------------------- Writes a single byte to any flat real-mode memory address. Like PEEK, addresses span the full 20-bit real-mode address space (0h through FFFFFh). On success, prints "OK" unless suppressed with /S. Syntax: POKE address value [/S] Parameters: address Flat memory address in hex with h suffix (e.g. B8000h). Up to 5 hex digits. Range: 0h to FFFFFh. value Byte value to write, in hex with h suffix (e.g. FFh). Range: 0h to FFh. Switches: /S Silent. Suppresses the "OK" confirmation message. Examples: POKE B8000h 41h Write 'A' to first character of text video RAM POKE B8001h 1Fh Write bright-white-on-blue attribute byte POKE B8001h 80h Set blink attribute on first character POKE 46Ch 0h Reset BIOS timer low byte (sets clock toward midnight) POKE 100h FFh /S Write silently, no output Notes: - POKE is an external command; POKE.COM must be available in the current directory or in a directory on your PATH (C:\DOS\ by default). - Addresses and values are entered in hexadecimal with an h suffix. Both uppercase and lowercase hex digits are accepted. - The /S switch may appear anywhere after the two required arguments. WARNING: POKE has direct, unprotected access to all of physical memory. Writing to the wrong address can crash the system immediately and without any error message. There is no undo. In particular: - Addresses 0h-3FFh are the interrupt vector table. Corrupting a vector will cause a crash the next time that interrupt fires. The hardware timer (INT 8h, vector at 20h-23h) fires approximately 18 times per second; corrupting it will crash the system within milliseconds whether or not you are doing anything. - Addresses 84h-87h hold the INT 21h (DOS API) vector. Corrupting this causes a crash on the very next DOS call, which COMMAND.COM makes constantly. - ROM addresses (C0000h and above) cannot be written. The write will silently have no effect. Related commands: PEEK, JMP, HEXDUMP ------------------------------------------------------------------------------- PATH - Display or Set Executable Search Path ------------------------------------------------------------------------------- Displays the current executable search path, sets a new one, or clears it. When you run a program, DR DOS searches the current directory first, then each directory in the PATH (left to right), trying .COM, .EXE, and .BAT in that order. Syntax: PATH PATH [drive:]path[;[drive:]path...] PATH ; Parameters: (none) Display the current search path path Semicolon-separated list of directories to search ; Clear the search path (current directory only) Examples: PATH Display current path PATH C:\DOS Search C:\DOS after the current directory PATH C:\DOS;C:\TOOLS Search C:\DOS, then C:\TOOLS PATH ; Clear search path (current directory only) Notes: - PATH is a built-in command, always available at the interactive prompt and in batch files. - The current directory is always searched first, before any PATH entry. - The default PATH is C:\DOS, so the standard utilities are found automatically. - Use semicolons to separate multiple directories. - The current directory is searched for .COM, .EXE, and .BAT extensions in that order within each PATH entry. - A PATH directory on a drive with no disk shows the "Abort, Retry, Fail ?" prompt. After F, DR DOS prints "Search path contains invalid drive" and goes on with the next directory. Related commands: None ------------------------------------------------------------------------------- REBOOT - Restart System ------------------------------------------------------------------------------- Restarts the computer. Syntax: REBOOT Parameters: None Notes: - REBOOT is an external command; REBOOT.COM must be available. - All unsaved work will be lost. - This performs a warm boot (restart) of the system. WARNING: Save all work before using REBOOT. ------------------------------------------------------------------------------- REN - Rename File or Directory ------------------------------------------------------------------------------- Renames an existing file or directory. Can also move a file to a different directory on the same drive. Syntax: REN oldname newname RENAME oldname newname Parameters: oldname The current name (or path) of the file or directory newname The new name (or path) for the file or directory Examples: REN OLD.TXT NEW.TXT RENAME LETTER.DOC LETTER.BAK REN DOCS ARCHIVE REN \WORK\REPORT.TXT \DONE\REPORT.TXT Notes: - REN and RENAME are identical commands. - The new name cannot already exist in the destination directory. - When renaming a directory, all files and subdirectories within it are preserved. - Names longer than 66 characters are refused with "Filename too long" (see Appendix A). Related commands: COPY, MOVE ------------------------------------------------------------------------------- RENAME - Rename File or Directory ------------------------------------------------------------------------------- Identical to REN. See REN for details. ------------------------------------------------------------------------------- SET - Display or Modify Environment Variables ------------------------------------------------------------------------------- Displays, searches, creates, modifies, or removes environment variables. Syntax: SET SET prefix SET name=value SET name= Parameters: (none) Display all environment variables prefix Display variables whose names start with prefix name=value Set variable name to value name= Remove variable name from the environment Examples: SET Display all variables SET C Display variables starting with C SET MYDIR=C:\WORK Create or update MYDIR SET MYDIR= Remove MYDIR Notes: - SET is a built-in command, always available at the interactive prompt and in batch files. - Variable names are case-insensitive. - Variables can be referenced in commands and batch files using %VARNAME% syntax. - The COMSPEC variable is set automatically by the system and should not be modified. Related commands: ECHO ------------------------------------------------------------------------------- RD - Remove Directory ------------------------------------------------------------------------------- Removes an empty directory. Syntax: RD dirname RMDIR dirname Parameters: dirname The directory to remove Examples: RD TEMP RD C:\OLD\BACKUP RMDIR EMPTY Notes: - RD and RMDIR are identical commands. - The directory must be empty before it can be removed. Hidden and system files count, and DIR lists them, but DEL *.* does not delete them: clear their attributes with ATTRIB -H -S first, then use DEL. - You cannot remove the current directory. - You cannot remove the root directory. - A directory that is not empty, or that you are currently in, prints "Directory not empty or in use". A path that does not exist prints "Invalid directory specified". A drive that does not exist prints "Invalid drive specified". See Appendix A. - Names longer than 66 characters are refused with "Filename too long" (see Appendix A). Related commands: MD, CD ------------------------------------------------------------------------------- RMDIR - Remove Directory ------------------------------------------------------------------------------- Identical to RD. See RD for details. ------------------------------------------------------------------------------- TIME - Display or Set System Time ------------------------------------------------------------------------------- Displays the current system time or sets a new time. Syntax: TIME [hh:mm[:ss[.hh]]] Parameters: hh:mm Set time (hours and minutes; seconds default to 00) hh:mm:ss Set time (hours, minutes, and seconds) hh:mm:ss.hh Set time (hours, minutes, seconds, and hundredths) Examples: TIME Display current time and prompt for new time TIME 10:30:00 Set time to 10:30:00 TIME 23:42 Set time to 23:42:00 TIME 14:24:00.50 Set time to 14:24:00.50 Notes: - TIME is an external command; TIME.COM must be available in the current directory or in a directory on your PATH (C:\DOS\ by default). - When called without parameters, TIME displays the current time and prompts for a new time. - Press ENTER at the time prompt to keep the current time. - Hours use 24-hour format (0-23). - If an invalid time is entered, TIME displays "Invalid time specified" and re-prompts until a valid time or empty input is given. Related commands: DATE ------------------------------------------------------------------------------- TREE - Display Directory Hierarchy ------------------------------------------------------------------------------- Displays the directory hierarchy in a tabular format, listing each directory with its byte count, file count, and full path. Syntax: TREE [path] [/F] Parameters: path Starting directory (default: root of current drive) /F List individual files instead of directory summaries Examples: TREE Display all directories from the root TREE C:\DOS Display the hierarchy under C:\DOS TREE C:\DOS /F List all files under C:\DOS with details TREE C:\ Display all directories on drive C: Output format (default mode): Each line shows: bytes (right-aligned), file count, and the full lowercase path. Counts are per-directory only (not rolled up from subdirectories). A trailer line shows cumulative totals. bytes files path 4 1 c:\mydir 0 0 c:\mydir\empty total files 1 total bytes 4 Output format (/F mode): Each line shows: attributes, file size, date, time, and the full lowercase path. No header row is printed in /F mode. --a--- 4 7-31-26 8:41a c:\mydir\readme.txt total files 1 total bytes 4 Notes: - TREE is an external command; TREE.COM must be available. - Each directory is listed before its subdirectories. - If the argument names a file rather than a directory, TREE prints a single /F-style file row plus the totals trailer. - If the argument does not exist, TREE prints an error message. - Large numbers are formatted with comma thousands separators. - Without a path argument, TREE lists the current drive from its root (not from the current working directory). Related commands: DIR, ATTRIB ------------------------------------------------------------------------------- TYPE - Display File Contents ------------------------------------------------------------------------------- Displays the contents of a text file on screen. Syntax: TYPE filename Parameters: filename The file to display Examples: TYPE README.TXT TYPE C:\DOCS\LETTER.DOC Notes: - TYPE is an external command; TYPE.COM must be available. - Use TYPE only on text files. Binary files will display meaningless characters. - For long files, use TYPE filename | MORE to page through the output one screen at a time. - If the file cannot be shown, TYPE prints the message for the error (File not found, Invalid directory specified, Access denied, Invalid drive specified, Too many files open, Physical Media Error, or Internal Error Code nnn) and exits with code 1. Related commands: COPY, HEXDUMP, MORE ------------------------------------------------------------------------------- XCOPY - Copy Files and Directory Trees ------------------------------------------------------------------------------- Copies files and optionally entire directory trees from one location to another. Unlike COPY, XCOPY can recurse into subdirectories. Syntax: XCOPY source destination [/S] [/E] Parameters: source File, filespec, or directory to copy from destination Directory or file to copy to /S Include subdirectories that contain files /E Create empty subdirectories (use with /S) /? Display help Examples: XCOPY C:\SRC C:\BACKUP Copy top-level files only XCOPY C:\SRC C:\BACKUP /S Copy files and subdirectories XCOPY C:\SRC C:\BACKUP /S /E Copy everything including empty directories Output format: XCOPY first prints "Reading source file(s)..." then "Writing destination file(s)..." followed by the destination path of each file copied, and the number of files at the end: Writing destination file(s)... c:\backup\readme.txt 1 File(s) copied Notes: - XCOPY is an external command; XCOPY.EXE must be available. - Without /S, only top-level files matching the source pattern are copied. Subdirectories are not descended into. - With /S, XCOPY recurses into subdirectories that contain matching files. Empty subdirectories are not created at the destination. - With /S /E, XCOPY recurses into all subdirectories and creates empty subdirectories at the destination as well. - If the source is a bare directory name (no wildcards), it is treated as directory\*.* (all files in that directory). - Hidden and system files are excluded from the copy by default. - File timestamps are preserved: the destination file receives the same date and time as the source. - If the destination does not exist and has no trailing backslash, XCOPY prompts whether to treat it as a file or directory. - If the destination does not exist but has a trailing backslash, XCOPY creates it as a directory without prompting. - XCOPY exits with ERRORLEVEL 0 on success and nonzero if the source path does not resolve. - Recursion is limited to 16 levels of directory nesting. Related commands: COPY, MOVE ------------------------------------------------------------------------------- VER - Display Version ------------------------------------------------------------------------------- Displays the DR DOS version number. Syntax: VER Parameters: None Output: DR DOS (R) 9.0 rev 1390 Copyright 2022-2026 Whitehorn Ltd. Co., All Rights Reserved The revision number shown (e.g., "rev 1390") is the build version. Notes: - VER is a built-in command, always available. Related commands: None =============================================================================== APPENDIX A: ERROR MESSAGES =============================================================================== This appendix lists error messages you may encounter and their meanings. Command or filename not recognized The command you typed is not a built-in command, and no program with that name was found in the current directory or in any directory on your PATH. Solution: Check the spelling of the command. Verify that the program file exists in the expected location. File not found - The file you specified does not exist. Solution: Check the spelling of the filename. Use DIR to verify the file exists in the expected location. Invalid directory specified The directory path you specified does not exist. Solution: Check the spelling of the directory name. Use DIR to see available directories. Invalid drive specified The drive letter you used does not exist on this system. CD, MD, RD and DIR all report this, as does typing a drive letter and colon on its own (for example Z:) to switch drives. Solution: Use a drive letter that exists. DR DOS assigns A: and B: to floppy drives and C: onward to hard disk partitions found at boot. Path required RD was typed without a directory name. Solution: Supply the directory to remove, for example RD TEMP. Directory not empty or in use RD could not remove the directory. Either it still contains files or subdirectories, or it is the directory you are currently in, or it is in use by another program. Solution: Use DIR to list the directory's contents and remove them first (DEL removes files, RD removes empty subdirectories). If it is your current directory, CD somewhere else, for example CD \, before removing it. Filename too long A file or directory name typed after DEL, ERASE, MD, MKDIR, RD, RMDIR, COPY, REN or RENAME is longer than 66 characters. Nothing is deleted, created, removed, copied or renamed. Solution: CD into the directory first and use a shorter, relative file name. Environment Full There was not enough room left in the environment to store the variable. The environment holds 256 bytes by default, part of which is already used by COMSPEC, PATH and PROMPT. SET at the prompt, and SET or PATH inside a batch file, can all report this. Solution: Remove variables you no longer need by setting them to nothing (for example SET TEMP=), or shorten PATH. To make the environment permanently larger, add a SHELL= line to CONFIG.SYS with the /E: switch, for example: SHELL=C:\COMMAND.COM /P /E:512 Required parameter missing A command requires a parameter that you did not provide. Solution: Check the command syntax and provide all required parameters. Unable to create destination file COPY could not create the destination file. Solution: Verify that the disk is not write-protected or full. Read error An error occurred while reading from the disk. Solution: The disk may be damaged. Try the operation again. If the problem persists, the disk may need to be replaced. Write error An error occurred while writing to the disk. Solution: The disk may be full, write-protected, or damaged. Check disk space and write-protect status. Access denied The command could not be carried out because a file or directory cannot be written or used as given. Causes: - CD was given two separators right after the drive letter (for example CD C:\\WORK). - An output redirection (> or >>) names a file that is read-only, a directory, or a file on a read-only drive such as the CD-ROM drive, or the file cannot be created because the root directory is full. The command line is not run. - COPY was given a destination file that is read-only (or cannot be created because the directory is full), a destination directory that holds a directory with the source's name, or a destination on a network drive that refuses to create the file. Nothing is copied and "0 file(s) copied" is shown. Solution: For CD, type the path with a single backslash after the colon. For a read-only file, clear the read-only attribute with ATTRIB -R, or redirect or copy to another file name. Access denied - You attempted to access a file that is protected. Solution: The file may be read-only or in use by another program. Clear the read-only attribute before attempting to modify the file. Unable to create directory The system could not create the directory. Solution: Verify that the parent directory exists. The directory you're trying to create must be inside an existing directory. Duplicate file name or file not found An error occurred while renaming a file. Solution: The new name may already exist, or the old name does not exist. Use DIR to verify the file names. Overwrite (Yes/No/All)? The destination file already exists during a MOVE operation. Solution: Enter Y to overwrite this file, N to skip it, or A to overwrite all remaining files without prompting. Error moving file An error occurred while moving a file. Solution: Check the file names and ensure you have permission to access both the source and destination files. ...Operating System error code N MOVE copied a file from or to a CD-ROM or network drive but could not delete the original. The copy is complete and stays. Solution: Delete the original yourself if the drive allows it. : ...access denied MOVE could not create the new file on the other drive (a CD-ROM cannot be written), or a read-only file of that name stands in its place. Nothing is changed. Solution: Choose a destination on a drive that can be written, or remove the read-only attribute of the file in the way. Not enough disk space The disk filled up while MOVE copied a file to or from a CD-ROM or network drive. The new file is removed and the original is not touched. Solution: Free space on the destination drive, or choose another. Unable to make directory "" MOVE needed to create a directory for the destination (a wildcard source or a wildcard pattern in the file name) and could not, because a file with that name is in the way. Nothing is moved. Solution: Remove or rename the file that is blocking the path, or choose a different destination. Cannot MOVE to/from a reserved device The destination of MOVE names a character device such as CON, NUL or PRN. Nothing is moved. Solution: Choose a destination that is not a device name. File not found No files were found matching the specified pattern. Solution: Check the filename or pattern. Use DIR to see available files. Invalid parameter An invalid parameter was provided. Solution: Check the command syntax and ensure all parameters are valid. Syntax: MOVE source destination The MOVE command was called with incorrect syntax. Solution: Check the MOVE command syntax and ensure you provide both a source and destination. =============================================================================== APPENDIX B: BATCH PROGRAMMING GUIDE =============================================================================== This appendix is a comprehensive programmer's reference for writing batch scripts in DR DOS. It covers all supported commands, flow control, variable handling, file operations, and practical patterns. WHAT IS A BATCH FILE? A batch file is a plain text file with a .BAT extension containing a sequence of commands executed line by line. Batch files automate repetitive tasks, create simple installers, and build menus. Create batch files with EDIT or any text editor. Each line contains one command. Blank lines are ignored. ------------------------------------------------------------------------------- COMMENTS: REM ------------------------------------------------------------------------------- Use REM to add comments. Everything after REM on the line is ignored. REM This is a comment REM Author: John Smith REM Last modified: February 2026 Comments document your script's purpose, explain complex logic, and leave notes for future maintenance. ------------------------------------------------------------------------------- DISPLAYING TEXT: ECHO ------------------------------------------------------------------------------- ECHO displays messages to the screen. ECHO Hello, World! ECHO Installation complete. ECHO. ECHO. (with a period, no space) prints a blank line. Echo State: By default, each command is displayed before execution. Control this with ECHO OFF and ECHO ON: ECHO OFF REM Commands below this line are not displayed ECHO This message still appears ECHO ON REM Commands are displayed again ECHO OFF suppresses command display but ECHO messages still appear. Use ECHO alone (no argument) to display the current echo state. ------------------------------------------------------------------------------- SUPPRESSING ECHO: @ ------------------------------------------------------------------------------- Prefix any command with @ to suppress its display for that line only. @ECHO OFF This is the standard first line of most batch files. The @ prevents "ECHO OFF" from being displayed, and ECHO OFF prevents subsequent commands from being displayed. @REM This comment won't be displayed @PAUSE ------------------------------------------------------------------------------- WAITING FOR INPUT: PAUSE ------------------------------------------------------------------------------- PAUSE halts execution and displays "Press any key to continue . . ." until the user presses a key. Any key will do, including the cursor and function keys, and the key is not passed on to the command or prompt that follows. ECHO About to delete temporary files... PAUSE DEL *.TMP Use PAUSE to give users time to read messages or confirm before potentially destructive operations. PAUSE waits for a key typed at the keyboard even when the batch file's input is redirected, for example PAUSE < ANSWERS.TXT, ECHO Y | PAUSE, or a batch file started with COMMAND /C MYBAT.BAT < ANSWERS.TXT. PAUSE does not read the redirected input, so the commands after it receive all of it. ------------------------------------------------------------------------------- LABELS AND GOTO ------------------------------------------------------------------------------- Labels mark locations in your script. A label is a line beginning with a colon followed by a name: :START :MENU :END Label names are case-insensitive. :START, :Start, and :start are identical. GOTO transfers execution to a label: GOTO END ECHO This line is never executed :END ECHO Script finished Exiting Early with GOTO :EOF: Use GOTO :EOF to exit the batch file immediately without needing to define an :END label: @ECHO OFF IF "%1"=="" GOTO :EOF ECHO Processing %1... This is cleaner than jumping to a label at the end of the file. Creating Loops: Combine GOTO with labels to create loops: :LOOP ECHO Press any key to continue, or Ctrl+C to exit PAUSE GOTO LOOP Organizing Code Sections: @ECHO OFF GOTO MAIN :USAGE ECHO Usage: INSTALL source GOTO :EOF :MAIN IF "%1"=="" GOTO USAGE ECHO Installing from %1... COPY %1 C:\PROGRAM\ ------------------------------------------------------------------------------- CONDITIONAL EXECUTION: IF ------------------------------------------------------------------------------- IF executes a command only when a condition is true. IF is available both at the interactive COMMAND.COM prompt and inside batch files. Testing File Existence: IF EXIST CONFIG.SYS ECHO Config file found IF EXIST C:\DOS\MOUSE.COM MOUSE IF EXIST checks whether a file exists. The command after the filename executes only if the file is found. Testing Device Names: IF EXIST also works with device names like NUL and CON: IF EXIST NUL ECHO Device support available Since NUL is a built-in device, this always succeeds. This can be used to verify batch file compatibility. String Comparison: IF "%1"=="HELP" GOTO SHOWHELP IF "%1"=="" ECHO No parameter provided Strings must be enclosed in double quotes. The comparison is case-sensitive: "YES" does not equal "yes". Tip: Always quote both sides when comparing parameters. If %1 is empty, IF %1=="" becomes IF =="" which is a syntax error. Using IF "%1"=="" becomes IF ""=="" which works correctly. Testing Exit Codes with ERRORLEVEL: Programs return exit codes (0-255) when they finish. Use IF ERRORLEVEL to test these codes and handle success or failure: PROGRAM.EXE IF ERRORLEVEL 1 ECHO Program failed! IF NOT ERRORLEVEL 1 ECHO Program succeeded! IF ERRORLEVEL n is true if the exit code is GREATER THAN OR EQUAL TO n. This means you must test higher values first: MYAPP.EXE IF ERRORLEVEL 3 GOTO FATAL_ERROR IF ERRORLEVEL 2 GOTO SERIOUS_ERROR IF ERRORLEVEL 1 GOTO MINOR_ERROR ECHO Success! GOTO :EOF :MINOR_ERROR ECHO Warning: minor issue detected GOTO :EOF :SERIOUS_ERROR ECHO Error: something went wrong GOTO :EOF :FATAL_ERROR ECHO FATAL: critical failure! GOTO :EOF DR DOS Command Exit Codes: Built-in and external commands return these codes: Command Success Failure Notes -------- ------- ------- ------------------------------------ COPY 0 1 1 if source not found or write fails DEL 0 1 1 if file not found or access denied REN 0 1 1 if file not found or name exists MD 0 1 1 if directory exists or path invalid RD 0 1 1 if directory not empty or not found CD 0 1 1 if directory not found TYPE 0 1 1 if the file cannot be shown DIR 0 1 1 if path not found (not if no files) MOVE 0 nonzero If a file could not be moved EDIT 0 - Always returns 0 MEM 0 - Always returns 0 Testing Multiple Error Levels: Remember that IF ERRORLEVEL n is true when the code is >= n. Always test higher values first to distinguish between different error conditions: MYAPP.EXE IF ERRORLEVEL 5 GOTO ACCESS_DENIED IF ERRORLEVEL 3 GOTO PATH_ERROR IF ERRORLEVEL 2 GOTO FILE_ERROR IF ERRORLEVEL 1 GOTO GENERAL_ERROR ECHO Operation successful. GOTO :EOF :FILE_ERROR ECHO Error: File not found. GOTO :EOF :PATH_ERROR ECHO Error: Directory not found. GOTO :EOF :ACCESS_DENIED ECHO Error: Access denied - check file permissions. GOTO :EOF :GENERAL_ERROR ECHO Error: Operation failed. Negating Conditions: IF NOT reverses the condition: IF NOT EXIST TEMP MD TEMP IF NOT "%1"=="" GOTO PROCESS IF NOT ERRORLEVEL 1 ECHO Success! This creates the TEMP directory only if it doesn't exist, processes only if a parameter was provided, or reports success if exit code is 0. ------------------------------------------------------------------------------- PARAMETERS: %0 THROUGH %9 ------------------------------------------------------------------------------- Batch files accept up to 9 parameters from the command line, accessed as %1 through %9. %0 contains the batch file's own name. Example batch file GREET.BAT: @ECHO OFF ECHO Hello, %1! ECHO This script is: %0 Running: GREET John Output: Hello, John! This script is: GREET.BAT Using Multiple Parameters: BACKUP.BAT: @ECHO OFF IF "%1"=="" GOTO USAGE IF "%2"=="" GOTO USAGE ECHO Copying %1 to %2... COPY %1 %2 ECHO Done. GOTO :EOF :USAGE ECHO Usage: BACKUP source destination Running: BACKUP README.TXT D:\BACKUP\README.TXT Literal Percent Sign: Use %% to include a literal percent sign: ECHO Disk is 50%% full Displays: Disk is 50% full ------------------------------------------------------------------------------- SHIFT: ACCESSING MORE THAN 9 PARAMETERS ------------------------------------------------------------------------------- SHIFT moves all parameters down by one position: Before SHIFT: %0=SCRIPT %1=A %2=B %3=C %4=D After SHIFT: %0=A %1=B %2=C %3=D %4=(empty) This allows processing an unlimited number of parameters in a loop: LISTALL.BAT - Display all parameters: @ECHO OFF :LOOP IF "%1"=="" GOTO :EOF ECHO Parameter: %1 SHIFT GOTO LOOP Running: LISTALL one two three four five six Output: Parameter: one Parameter: two Parameter: three Parameter: four Parameter: five Parameter: six Processing Multiple Files: DELALL.BAT - Delete all specified files: @ECHO OFF IF "%1"=="" GOTO USAGE :LOOP IF "%1"=="" GOTO DONE IF EXIST %1 DEL %1 IF EXIST %1 ECHO Failed to delete: %1 IF NOT EXIST %1 ECHO Deleted: %1 SHIFT GOTO LOOP :DONE ECHO All files processed. GOTO :EOF :USAGE ECHO Usage: DELALL file1 file2 file3 ... Note: After SHIFT, the original %0 (script name) is lost. Save it to a variable first if needed. ------------------------------------------------------------------------------- ENVIRONMENT VARIABLES: %VARNAME% ------------------------------------------------------------------------------- Access environment variables by surrounding the name with percent signs: ECHO Command interpreter: %COMSPEC% ECHO My directory: %MYDIR% A variable that is not set is replaced by nothing: ECHO Value is: %UNDEFINED% Output: Value is: Using Variables in Conditions: IF "%COMSPEC%"=="" ECHO COMSPEC not defined! IF NOT "%MYDIR%"=="" ECHO MYDIR is set Working with Environment Variables using SET: Use SET with no arguments to display all environment variables: SET Use SET with a prefix to show only matching variables: SET P Show variables starting with P SET COM Show variables starting with COM Use SET VAR=value to create or modify a variable: SET MYDIR=C:\WORK SET GREETING=Hello Use SET VAR= (with nothing after the equals sign) to remove a variable: SET MYDIR= ------------------------------------------------------------------------------- CALLING OTHER BATCH FILES: CALL ------------------------------------------------------------------------------- Use CALL to execute another batch file and return to continue: @ECHO OFF ECHO Starting installation... CALL SETUP.BAT ECHO Setup complete, running configuration... CALL CONFIG.BAT %1 ECHO All done! Without CALL, executing a batch file transfers control permanently and does not return to the calling script. Passing Parameters: Parameters passed to CALL are available in the called script: MAIN.BAT: @ECHO OFF CALL HELPER.BAT first second HELPER.BAT: @ECHO OFF ECHO Received: %1 and %2 Running MAIN.BAT outputs: Received: first and second Nested Calls: Batch files can call other batch files that call others: MAIN.BAT -> CALL INIT.BAT -> CALL CHECK.BAT -> returns -> returns Each CALL remembers where to return. Deep nesting may exhaust memory. Redirection: To redirect a called batch file's output, use COMMAND /C: COMMAND /C SUB.BAT > LOG.TXT COMMAND /C SUB.BAT >> LOG.TXT See the COMMAND section for details on the /C switch. ------------------------------------------------------------------------------- FILE OPERATIONS ------------------------------------------------------------------------------- Batch files include built-in commands for common file operations. COPY - Copy Files: COPY README.TXT BACKUP.TXT COPY %1 %2 DEL / ERASE - Delete Files: DEL TEMP.TXT DEL *.BAK ERASE OLD.DAT Wildcards (* and ?) are supported. DEL *.* asks for confirmation; type Y and press Enter to confirm. Naming a directory deletes all files in it, after the same question. REN / RENAME - Rename Files and Directories: REN OLDNAME.TXT NEWNAME.TXT REN DOCS ARCHIVE REN \WORK\FILE.TXT \DONE\FILE.TXT RENAME %1 %2 MD / MKDIR - Create Directories: MD NEWDIR MKDIR C:\PROGRAMS\MYAPP IF NOT EXIST TEMP MD TEMP RD / RMDIR - Remove Directories: RD EMPTYDIR RMDIR C:\OLD\TEMP The directory must be empty. CD / CHDIR - Change Directory: CD \ CHDIR C:\DOS CD .. CD.. (space optional) Changes the current directory for subsequent commands. ------------------------------------------------------------------------------- OUTPUT REDIRECTION ------------------------------------------------------------------------------- Redirect command output to a file using >: DIR > FILELIST.TXT ECHO Installation log > INSTALL.LOG MEM > MEMINFO.TXT The file is created or overwritten, unless it is read-only: then the command line is refused with "Access denied" and the file is left as it was (see I/O REDIRECTION in Chapter 6). Discarding Output with NUL: Redirect to NUL to discard unwanted output: DEL *.TMP > NUL COPY FILE.DAT BACKUP.DAT > NUL This suppresses success messages while still showing errors. For full details on all redirection operators (>, >>, <) and piping (|), see the I/O Redirection and Piping sections in Chapter 6. ------------------------------------------------------------------------------- PRACTICAL PATTERNS ------------------------------------------------------------------------------- Standard Script Header: @ECHO OFF REM ============================================= REM SCRIPTNAME.BAT - Brief description REM Author: Your Name REM Date: February 2026 REM ============================================= Parameter Validation: @ECHO OFF IF "%1"=="" GOTO USAGE IF "%2"=="" GOTO USAGE REM ... main script logic ... GOTO :EOF :USAGE ECHO Usage: %0 source destination ECHO. ECHO Copies source file to destination. Error Handling with ERRORLEVEL: @ECHO OFF ECHO Compiling program... COMPILER.EXE %1 IF ERRORLEVEL 1 GOTO FAILED ECHO Compilation successful! GOTO :EOF :FAILED ECHO Compilation failed with errors. Cleanup on Exit: @ECHO OFF ECHO Creating temporary files... COPY %1 TEMP.DAT REM ... do work ... ECHO Cleaning up... DEL TEMP.DAT ECHO Done. Installer Pattern: @ECHO OFF ECHO ================================ ECHO MyProgram Installation ECHO ================================ ECHO. REM Check for required parameter IF "%1"=="" GOTO USAGE REM Create installation directory IF NOT EXIST C:\MYAPP MD C:\MYAPP REM Copy files ECHO Copying files... COPY %1\MYAPP.EXE C:\MYAPP\ > NUL IF ERRORLEVEL 1 GOTO FAILED ECHO. ECHO Installation complete! ECHO Run C:\MYAPP\MYAPP.EXE to start. GOTO :EOF :FAILED ECHO Installation failed! GOTO :EOF :USAGE ECHO Usage: INSTALL sourcedir Conditional Setup: @ECHO OFF IF NOT EXIST C:\GAMES MD C:\GAMES IF EXIST C:\GAMES\GAME.EXE GOTO RUN ECHO Game not installed. GOTO :EOF :RUN C:\GAMES\GAME.EXE Processing Multiple Files with Wildcards: Use wildcards to operate on groups of files: @ECHO OFF ECHO Deleting all backup files... DEL *.BAK DEL *.TMP DEL *.OLD ECHO Done. Using CALL for Modular Scripts: MAIN.BAT: @ECHO OFF CALL INIT.BAT IF ERRORLEVEL 1 GOTO FAILED CALL PROCESS.BAT %1 IF ERRORLEVEL 1 GOTO FAILED CALL CLEANUP.BAT ECHO Success! GOTO :EOF :FAILED ECHO An error occurred. ------------------------------------------------------------------------------- DEBUGGING TIPS ------------------------------------------------------------------------------- Remove @ECHO OFF Temporarily: Comment out or remove @ECHO OFF to see each command as it executes: REM @ECHO OFF IF "%1"=="" GOTO USAGE ... This shows exactly what the batch file is doing. Add Progress Messages: ECHO DEBUG: About to copy files... COPY %1 %2 IF ERRORLEVEL 1 ECHO DEBUG: Copy FAILED IF NOT ERRORLEVEL 1 ECHO DEBUG: Copy successful Use PAUSE for Breakpoints: ECHO About to delete files - press Ctrl+C to abort PAUSE DEL *.TMP Check Variable Values: ECHO Parameter 1 is: [%1] ECHO Parameter 2 is: [%2] Brackets make it easy to spot empty or whitespace values. ------------------------------------------------------------------------------- QUICK REFERENCE ------------------------------------------------------------------------------- Flow Control: ------------------ -------------------------------------------------- REM text Comment (ignored) ECHO message Display message ECHO. Display blank line ECHO OFF Stop displaying commands ECHO ON Resume displaying commands @command Execute without displaying this line PAUSE Wait for keypress :label Define a label (target for GOTO) GOTO label Jump to label GOTO :EOF Exit batch file immediately CALL file [args] Execute batch file and return Conditionals: ------------------ -------------------------------------------------- IF EXIST file cmd Execute cmd if file exists IF NOT EXIST file cmd Execute cmd if file doesn't exist IF ERRORLEVEL n cmd Execute cmd if exit code >= n IF NOT ERRORLEVEL n Execute cmd if exit code < n IF "a"=="b" cmd Execute cmd if strings match IF NOT "a"=="b" cmd Execute cmd if strings differ Variables: ------------------ -------------------------------------------------- %0 Batch file name %1 - %9 Command line parameters %% Literal percent sign %VARNAME% Environment variable value SHIFT Shift parameters left SET Display all environment variables SET prefix Display variables starting with prefix SET VAR=value Set environment variable SET VAR= Remove environment variable File Operations: ------------------ -------------------------------------------------- COPY src dest Copy a file or the files of a wildcard DEL file Delete a file (also: ERASE) MOVE src dest Move a file REN old new Rename a file or directory (also: RENAME) MD dir Create directory (also: MKDIR) RD dir Remove directory (also: RMDIR) CD path Change directory (also: CHDIR) Memory Management: ------------------ -------------------------------------------------- LOADHIGH prog Load program into upper memory (also: LH, HILOAD) Redirection and Piping: ------------------ -------------------------------------------------- cmd > file Redirect output to file cmd >> file Append output to file cmd < file Redirect input from file cmd1 | cmd2 Pipe output to another command cmd > NUL Discard output ------------------------------------------------------------------------------- EXAMPLE PROGRAMS ------------------------------------------------------------------------------- This section provides complete, ready-to-use batch file examples that demonstrate common tasks and techniques. All examples use only features available in DR DOS. Example 1: CLEANUP.BAT - Delete Temporary Files ------------------------------------------------ Removes common temporary files from the current directory. @ECHO OFF REM ============================================= REM CLEANUP.BAT - Remove temporary files REM ============================================= ECHO Cleaning up temporary files... ECHO. IF EXIST *.TMP DEL *.TMP IF EXIST *.BAK DEL *.BAK IF EXIST *.OLD DEL *.OLD ECHO Cleanup complete. Example 2: BACKUP.BAT - Backup Files to Another Directory ---------------------------------------------------------- Copies important files to a backup directory, creating it if needed. @ECHO OFF REM ============================================= REM BACKUP.BAT - Backup files to D:\BACKUP REM Usage: BACKUP filename REM ============================================= IF "%1"=="" GOTO USAGE REM Create backup directory if it doesn't exist IF NOT EXIST D:\BACKUP MD D:\BACKUP REM Check if source file exists IF NOT EXIST %1 GOTO NOTFOUND ECHO Backing up %1 to D:\BACKUP... COPY %1 D:\BACKUP IF ERRORLEVEL 1 GOTO FAILED ECHO Backup successful. GOTO :EOF :NOTFOUND ECHO ERROR: File %1 not found. GOTO :EOF :FAILED ECHO ERROR: Backup failed. GOTO :EOF :USAGE ECHO Usage: BACKUP filename ECHO. ECHO Copies the specified file to D:\BACKUP directory. Example 3: INSTALL.BAT - Simple Installer ------------------------------------------ Installs a program to a target directory with error checking. @ECHO OFF REM ============================================= REM INSTALL.BAT - Install MyProgram REM Usage: INSTALL [source_dir] REM ============================================= ECHO ================================ ECHO MyProgram Installation ECHO ================================ ECHO. REM Default source is current directory IF "%1"=="" GOTO USE_CURRENT IF NOT EXIST %1\MYAPP.EXE GOTO NOTFOUND GOTO INSTALL :USE_CURRENT IF NOT EXIST MYAPP.EXE GOTO NOTFOUND :INSTALL ECHO Creating program directory... IF NOT EXIST C:\MYAPP MD C:\MYAPP ECHO Copying program files... IF "%1"=="" GOTO COPY_CURRENT COPY %1\MYAPP.EXE C:\MYAPP > NUL GOTO CHECK_COPY :COPY_CURRENT COPY MYAPP.EXE C:\MYAPP > NUL :CHECK_COPY IF ERRORLEVEL 1 GOTO FAILED ECHO. ECHO Installation complete! ECHO. ECHO Run C:\MYAPP\MYAPP.EXE to start the program. GOTO :EOF :NOTFOUND ECHO ERROR: MYAPP.EXE not found. ECHO Please specify the source directory. GOTO :EOF :FAILED ECHO ERROR: Installation failed. Example 4: MENU.BAT - Simple Menu System ----------------------------------------- Displays a menu and runs programs based on batch file parameter. @ECHO OFF REM ============================================= REM MENU.BAT - Main Menu REM Usage: MENU [choice] REM ============================================= :SHOW_MENU CLS ECHO. ECHO ======================================== ECHO MAIN MENU ECHO ======================================== ECHO. ECHO 1. Run Directory Listing ECHO 2. Display Memory Status ECHO 3. Run Cleanup ECHO 4. Exit to DOS ECHO. ECHO To select, type: MENU 1, MENU 2, MENU 3, or MENU 4 ECHO. IF "%1"=="" GOTO :EOF IF "%1"=="1" GOTO OPTION1 IF "%1"=="2" GOTO OPTION2 IF "%1"=="3" GOTO OPTION3 IF "%1"=="4" GOTO :EOF ECHO Invalid choice: %1 GOTO :EOF :OPTION1 DIR PAUSE GOTO :EOF :OPTION2 MEM PAUSE GOTO :EOF :OPTION3 CALL CLEANUP.BAT PAUSE GOTO :EOF Example 5: DEPLOY.BAT - Multi-Step Deployment ---------------------------------------------- Demonstrates CALL, ERRORLEVEL checking, and multi-step operations. @ECHO OFF REM ============================================= REM DEPLOY.BAT - Deploy application files REM Usage: DEPLOY source_dir target_dir REM ============================================= IF "%1"=="" GOTO USAGE IF "%2"=="" GOTO USAGE ECHO Starting deployment... ECHO Source: %1 ECHO Target: %2 ECHO. REM Step 1: Validate source ECHO Step 1: Validating source directory... IF NOT EXIST %1 GOTO NO_SOURCE REM Step 2: Create target ECHO Step 2: Creating target directory... IF NOT EXIST %2 MD %2 IF ERRORLEVEL 1 GOTO MKDIR_FAILED REM Step 3: Copy new files ECHO Step 3: Copying new files... COPY %1\APP.EXE %2 > NUL IF ERRORLEVEL 1 GOTO COPY_FAILED ECHO. ECHO Deployment successful! GOTO :EOF :NO_SOURCE ECHO ERROR: Source directory %1 not found. GOTO :EOF :MKDIR_FAILED ECHO ERROR: Could not create directory %2. GOTO :EOF :COPY_FAILED ECHO ERROR: File copy failed. GOTO :EOF :USAGE ECHO Usage: DEPLOY source_dir target_dir ECHO. ECHO Copies all files from source to target directory. Example 6: ALLPARAM.BAT - Process All Parameters with SHIFT ------------------------------------------------------------ Demonstrates using SHIFT to handle unlimited parameters. @ECHO OFF REM ============================================= REM ALLPARAM.BAT - Process all command-line parameters REM Usage: ALLPARAM file1 file2 file3 ... REM ============================================= IF "%1"=="" GOTO USAGE ECHO Processing files... ECHO. :LOOP IF "%1"=="" GOTO DONE ECHO Checking: %1 IF EXIST %1 ECHO - File exists IF NOT EXIST %1 ECHO - File NOT found SHIFT GOTO LOOP :DONE ECHO. ECHO All parameters processed. GOTO :EOF :USAGE ECHO Usage: ALLPARAM file1 file2 file3 ... ECHO. ECHO Checks each specified file and reports if it exists. Example 7: SAFEDEL.BAT - Safe Delete with Confirmation ------------------------------------------------------- Deletes files only after confirming they exist. @ECHO OFF REM ============================================= REM SAFEDEL.BAT - Delete file with safety checks REM Usage: SAFEDEL filename REM ============================================= IF "%1"=="" GOTO USAGE IF NOT EXIST %1 GOTO NOTFOUND ECHO File to delete: %1 ECHO. ECHO Press any key to delete, or Ctrl+C to cancel... PAUSE > NUL DEL %1 IF ERRORLEVEL 1 GOTO FAILED IF EXIST %1 GOTO FAILED ECHO File deleted successfully. GOTO :EOF :NOTFOUND ECHO File %1 does not exist. GOTO :EOF :FAILED ECHO ERROR: Could not delete %1. GOTO :EOF :USAGE ECHO Usage: SAFEDEL filename ECHO. ECHO Deletes the specified file after confirmation. Example 8: DIRLOG.BAT - Save Directory Listing ----------------------------------------------- Saves a directory listing to a text file for later reference. @ECHO OFF REM ============================================= REM DIRLOG.BAT - Save directory listing to file REM Usage: DIRLOG [directory] REM ============================================= IF "%1"=="" GOTO CURRENT IF NOT EXIST %1 GOTO NOTFOUND CD %1 :CURRENT ECHO Saving directory listing... DIR > DIRLIST.TXT ECHO Directory saved to DIRLIST.TXT ECHO. ECHO Contents: TYPE DIRLIST.TXT GOTO :EOF :NOTFOUND ECHO Directory %1 not found. Example 9: RUNAPP.BAT - Run Application with Setup --------------------------------------------------- Sets up the environment before running a program. @ECHO OFF REM ============================================= REM RUNAPP.BAT - Run application with setup REM ============================================= ECHO Setting up environment... REM Ensure required directories exist IF NOT EXIST C:\TEMP MD C:\TEMP IF NOT EXIST C:\APP\DATA MD C:\APP\DATA REM Change to application directory CD C:\APP REM Run the application ECHO Starting application... MYAPP.EXE REM Check exit status IF ERRORLEVEL 1 GOTO ERROR ECHO Application completed normally. GOTO :EOF :ERROR ECHO Application exited with an error. Example 10: DAILY.BAT - Daily Maintenance Tasks ------------------------------------------------ Combines multiple maintenance operations into one script. @ECHO OFF REM ============================================= REM DAILY.BAT - Daily system maintenance REM Run this batch file once per day REM ============================================= ECHO ======================================== ECHO Daily Maintenance Starting ECHO ======================================== ECHO. REM Step 1: Clean temporary files ECHO Step 1: Cleaning temporary files... CD C:\TEMP IF EXIST *.TMP DEL *.TMP IF EXIST *.BAK DEL *.BAK CD \ REM Step 2: Create backup directory with today's files ECHO Step 2: Backing up important files... IF NOT EXIST D:\DAILY MD D:\DAILY IF EXIST C:\DOCS\README.TXT COPY C:\DOCS\README.TXT D:\DAILY > NUL REM Step 3: Report completion ECHO. ECHO ======================================== ECHO Maintenance Complete ECHO ======================================== ECHO. ECHO Temporary files cleaned. ECHO Documents backed up to D:\DAILY. =============================================================================== APPENDIX C: REPORTING BUGS AND ISSUES =============================================================================== We appreciate your help in making DR DOS better by reporting any issues you encounter. WHAT TO REPORT Please report any of the following: - System crashes or freezes - Filesystem corruption or data loss - Programs that don't run correctly - Unexpected error messages - Hardware or software incompatibilities - Any behavior that seems incorrect or unusual HOW TO REPORT A BUG You can report bugs in two ways: - Fill out the support form at: https://www.dr-dos.com/support.html - Send an email to: bugs@dr-dos.com Please include the following information in your report: 1. Version and Revision Run the VER command at the DOS prompt to see your version. It will display something like "DR DOS 9.0 rev 1390". Include the complete version string in your report. 2. Hardware or Virtualization Environment Examples: - QEMU 10.2 - VirtualBox 7.0 on Linux - Intel Pentium II PC with 440LX chipset, 128MB RAM - 86Box emulator 3. What You Were Doing Describe the task you were performing when the issue occurred. Examples: - "I was installing Lotus 1-2-3" - "I was playing Commander Keen Episode 1" - "I was copying files from C: to D:" 4. What Happened Describe what you saw on screen. Screenshots or photos are very helpful if possible. Include any error messages exactly as shown. GETTING HELP Website: https://www.dr-dos.com Support: https://www.dr-dos.com/support.html Bug Reports: bugs@dr-dos.com Check the website for documentation, updates, and known issues. Thank you for helping us improve DR DOS! =============================================================================== GLOSSARY =============================================================================== AUTOEXEC.BAT A batch file in the root directory of the boot drive that DR DOS executes automatically at startup. Used to set environment variables, load programs, and configure the system. Batch file A text file with a .BAT extension containing commands to be executed in sequence. Used for automation and scripting. Boot The process of starting up a computer and loading the operating system. CHS Cylinder-Head-Sector. A method of addressing disk sectors using the physical geometry of the drive. Common on systems before 1994. DR DOS fully supports CHS disk addressing. Command interpreter The program (COMMAND.COM) that displays the DOS prompt and executes your commands. Command prompt The text displayed by DOS (e.g., C:\>) indicating it is ready to accept a command. CONFIG.SYS A configuration file in the root directory that DR DOS processes at boot time. Used to load device drivers (DEVICE), set file handles (FILES), configure the command interpreter (SHELL), and control other system settings. Conventional memory The first 640KB of memory, directly accessible by DOS programs. This is the primary memory space for running programs. Current directory The directory where DOS looks for files by default. Displayed in the command prompt. Device A hardware component or pseudo-device accessible through a reserved name. DOS devices include CON (console), NUL (null device), AUX (auxiliary), PRN (printer), COM1-COM4 (serial ports) and LPT1-LPT3 (printer ports). Directory A container for files and other directories, used to organize the contents of a disk. Drive A device that reads and writes data to storage media. Identified by a letter (A:, C:, D:, etc.). EMS Expanded Memory Specification. A standard for accessing memory beyond 640KB through a page-mapped window. DR DOS provides EMS 4.0 support via the EMM386.SYS driver loaded in CONFIG.SYS. Environment variable A named value stored in the system environment, accessible to programs and batch files. Example: COMSPEC. ERRORLEVEL The exit code returned by a program when it finishes. Used in batch files with IF ERRORLEVEL to test for success or failure. Extension The part of a filename after the period, typically indicating the file type. Limited to 3 characters. External command A command that exists as a separate program file (.COM or .EXE) rather than being built into COMMAND.COM. FAT12 File Allocation Table (12-bit). A filesystem format used on floppy disks and small hard disk partitions. DR DOS supports FAT12 on all drives and detects it automatically. FAT16 File Allocation Table (16-bit). A filesystem format used on hard disk partitions. DR DOS supports FAT16 on all drives and detects it automatically. File A named collection of data stored on disk. HMA High Memory Area. The first 64KB of extended memory (minus 16 bytes), accessible in real mode. Used by DR DOS to load part of the kernel, freeing conventional memory. Internal command A command built into COMMAND.COM, always available without needing a separate program file. LBA Logical Block Addressing. A method of addressing disk sectors using a linear block number. Common on systems from 1994 onward. DR DOS fully supports LBA disk addressing. NUL A special device that discards all output written to it and returns empty input when read. Useful for suppressing output: command > NUL Page frame A 64KB window in upper memory (typically at segment D000h) through which EMS expanded memory pages are accessed. Parameter Information provided to a command that modifies its behavior. Path The complete specification of a file's location, including drive, directories, and filename. Redirection Sending a command's output to a file instead of the screen, using the > operator. Root directory The top-level directory on a disk, from which all other directories branch. VCPI Virtual Control Program Interface. A standard allowing DOS extenders and protected-mode programs to coexist with EMS memory managers. EMM386.SYS provides VCPI support. Wildcard A special character (* or ?) that matches multiple characters in a filename, used to specify groups of files. XMS Extended Memory Specification. A standard for accessing extended memory (above 1MB). DR DOS includes a built-in XMS driver and uses XMS as backing store for EMS. =============================================================================== END OF USER GUIDE =============================================================================== WHITEHORN LTD. CO. 3963 S Highway 97 #214 Sand Springs, OK 74063 DR DOS is a registered trademark of Whitehorn Ltd. Co. Copyright (c) 2022-2026 Whitehorn Ltd. Co. All rights reserved.