83G9260_IBM_PC_DOS_7.0_Users_Guide_Jan95 83G9260 IBM PC DOS 7.0 Users Guide Jan95

User Manual: 83G9260_IBM_PC_DOS_7.0_Users_Guide_Jan95

Open the PDF directly: View PDF PDF.
Page Count: 625

Download83G9260_IBM_PC_DOS_7.0_Users_Guide_Jan95 83G9260 IBM PC DOS 7.0 Users Guide Jan95
Open PDF In BrowserView PDF
-- -- ------- - -.--_

---

User's Guide
1111 tc.II ..........

II IIIcIIMIIII II1II ......

- . . c...hIIIJ'.... ...

..

......... IIICIII" .....

.....................

........l1IIiID...

,

~

/

Note

------------------------------------------------------------~

Before using this information and the product it supports, be sure to read the general
information under Appendix C, "Notices" on page 561.

First Edition (January 1995)
The following paragraph does not apply to the United Kingdom or any country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION
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. Some states do not allow disclaimer of express or
implied warranties in certain transactions, therefore, this statement may not apply to you.
This publication could include technical inaccuracies or typographical errors. Changes are periodically
made to the information herein; these changes will be incorporated in new editions of the publication. IBM
may make improvements and/or changes in the product(s) and/or the program(s) described in this
publication at any time.
It is possible that this publication may contain reference to, or information about, IBM products (machines
and programs), programming, or services that are not announced in your country. Such references or
information must not be construed to mean that IBM intends to announce such IBM products,
programming, or services in your country.
Requests for technical information about IBM products should be made to your IBM authorized reseller or
IBM marketing representative.
© Copyright International Business Machines Corporation 1981, 1995. All rights reserved.

Note to U.S. Government Users - Documentation related to restricted rights - Use, duplication or
disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp.

Foreword

PC DOS 7 is a new release in a long line of DOS releases from IBM. We have
added new functions, extended familiar utilities, and maintained the compatibility
you depend upon. Why? Because IBM wants to continue to provide the operating
systems that meet your needs.
Over time, some of you will move to a 32-bit operating system like OS/2. Many will
continue with PC DOS. Others will run both. Today, PC DOS 7 provides
comfortable reliability while adding features that help you get the most from your
PC. I hope you'll enjoy the new capabilities and enhancements in PC DOS 7.

Sheryl Winton
PC DOS Product Manager
Personal Systems Products

iii

iv

PC DOS User's Guide

Contributors

Author
Margaret Averett

Contributing Author
Dana Liburdi

Managing Editor
Larry Thorn

Publications Manager
M. B.' (Peg) Ryan

Information Development Planner

R. J. (Bob) Lotito

Production Coordinator
Eugene Ignatowski

Editor
Elizabeth Jean

National Language Support
Marion Bucko
Oystein Kleven

v

The PC DOS Team
Linda M. Boyer
Vernon C. Brooks
AI Cantu
Christopher Chapman
Fetchi Chen
Cono M. Cioffi
E. P. (Gene) Cook
Jeff Cope
Carla Bruner-Diaz
Bryan D. Dobbs
Mark R. Gehring
C. M (Matt) Hamilton
Susie E. Hunt
A. V. (Tony) Ingenoso
Nitin Jain
Doug D. Jones
Jane E. Jones
Jeff Kelley
Karl E. Lawall
Kay E. Lee
Sue Lichtenstein
Doug Love
R. F. (Bob) Maddaloni
Carline. Marcelin
Jim C. McDonald

Paige Menke
J. R. (Joe) Montero
R. A. (Tony) Muradaz
Eric D. Nill
Mark E. Nosewicz
Chris Ogozaly
Brett Oxen handler
Kamal C. Patel
Ben Rafanello
Robert A. Rapuano
Michael A. (Mike) Rothman
Michael E. Ryan
Doray Schillings
E. A. (Beth) Schreiber
Moshe Shmia
D. B. (Dave) Smith
Ryan Smith
Sandy C. Stewart
Sandra C. Sykes
Takahiro Tanaka
Sam Twining
Carter Wells
Sheryl M. Winton
Marie E. Wolfe
Laura E. Zalph

To the members of the PC DOS technical team and to the numerous others who
helped ensure the technical accuracy of the PC DOS documentation-a very
special Itthank you" for your support and continual dedication to quality.

vi .

PC DOS User's Guide

IBM Program License Agreement
IF YOU USE THIS PROGRAM, YOU AGREE TO THESE TERMS AND CONDITIONS FOR
THE PROGRAM INCLUDED IN THIS PACKAGE OR PRE·LOADED ON A SYSTEM.
The Program is licensed not sold. International Business Machines Corporation, or the applicable IBM
country organization, (IBM) grants you a license for the Program only in the country where you acquired
the Program. You obtain no rights other than those granted you under this license.
The term "Program" means the original and all whole or partial copies of it, including modified copies
or portions merged into other programs. IBM retains title to the Program. IBM owns, or has licensed
from the owner, copyrights in the Program.
You are responsible for the selection of the Program and for the installation of, use of, and results
obtained from, the Program.
The section, on the following pages, entitled "License Information" contains additional information on
the Program.

1. License
Under this license, you may:
1) use the Program on only one machine at anyone time, unless the License
Information specifies otherwise;
2) copy the Program for backup or in order to modify it;
3) modify the Program and/or merge it into another program as an essential utilization of the
Program in conjunction with your machine; and
4) transfer the possession of the Program to another party.
If you transfer the Program, you must transfer a copy of this license, the License Information, all
other documentation and at least one complete, unaltered copy of the Program to the other party.
You must, at the same time, either transfer all your other copies of the Program to the other party or
destroy them. Your license is then terminated. The other party agrees to these terms and
conditions by its first use of the Program.
You must reproduce the copyright notice(s) on each copy, or partial copy, of the Program.
You may not:
1) use, copy, modify, merge, or transfer copies of the Program except as
provided in this license;
2) reverse assemble or reverse compile the Program; or
3) sublicense, rent, lease, or assign the Program.

2. Limited Warranty
Some Programs have limited warranties. The warranty details and limitations are described in
their Statement of Limited Warranty. Some Programs are not warranted and IBM will specify that
they are provided "AS IS."
All Programs have a three-month limited warranty on their media.
THESE WARRANTIES ARE IN LIEU OF ALL OTHER WARRANTIES (OR CONDITIONS),
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Some jurisdictions do not allow exclusion of implied warranties, so the above exclusion may not
apply to you.

vii

3. Limitation of Remedies
IBM's entire liability under this license is the following.
IBM will provide any warranty described in IBM's Statement of Limited Warranty. IBM will
a) replace defective media, or b) make a warranted Program operate or replace the Program with a
functionally equivalent Program, as warranted. Otherwise, you may terminate your license, return all
your copies of the Program, and IBM will refund the amount you paid for the license.
For any claim (including fundamental breach), in any form, related in any way to this license, IBM's
liability will be for actual damages only and will be limited to the greater of:
1) the equivalent of U.S. $25,000 in your local currency; or
2) IBM's then generally available license fee for the Program.
This limitation will not apply to claims for bodily injury or damages to real or tangible personal
property for which IBM is legally liable.
IBM will not be liable for any lost profits, lost savings, or any incidental damages or other
economic consequential damages, even if IBM, or its authorized supplier, has.been advised of the
possibility of such damages. IBM will not be liable for any damages claimed by you based on any
third party claim.
This limitation of remedies also applies to any developer of a Program supplied to IBM. IBM's and,
the developer's limitations of remedies are not cumulative. Such developer is an intended
beneficiary of this Section.
Some jurisdictions do not allow these limitations or exclusions, so they may not apply to you.
4. General

You may terminate your license at any time. IBM may terminate your license if you fail to comply
with the terms and conditions of this license. In either event; you must destroy all your copies of the
Program.
You are responsible for payment of any taxes, including personal property taxes, resulting from
this license.
Neither party may bring an action, regardless of form, more than two years after the cause of the
action arose.
If you acquired your Program in the United States, this license is governed by the laws of the
State of New York. If you acquired the Program in Canada, this license is governed by the laws of
the Province of Ontario. Otherwise, this license is governed by the laws of the country in which you
acquired the Program.

viii

PC DOS User's Guide

License Information
International Business Machines Corporation

Armonk, New York 10504

STATEMENT OF LIMITED WARRANTY
(MEDIA AND PROGRAM)

International Business Machines Corporation (IBM*) grants the following limited warranty for this IBM
Licensed Program (Program) if this copy of the Program is delivered by IBM, an IBM Authorized Dealer
for this Program, or any other IBM approved supplier for this Program to a user. (Such a user is referred
to herein as "original user.") A "user" shall mean a Customer who acquired possession of and is
licensed to use this copy of the Program for its own use or for use within its own business enterprise and
not for remarketing. Any unused portion of the Warranty Period may be conveyed to another user.
1. MEDIA
The Warranty Period for the media on which the Program is recorded is for three months from the
date of its delivery to the original user as evidenced by a receipt.
IBM warrants that this media will be free from defects in material and workmanship under normal
use during the Warranty Period. If notified during the Warranty Period that the media contains such
defects, IBM will replace such media. If IBM is unable to deliver replacement media, you may
terminate your license and your money will be refunded upon return of all your copies of the
Program.
2. PROGRAM
The Warranty Period for this Program is for three months from the date of its delivery to the original
user as evidenced by a receipt.
IBM warrants that this Program, if unaltered, will conform to its Program Specifications during the
Warranty Period when such Program is properly used on a machine for which it was designed. If
notified during the Warranty Period that the Program contains defects such that it does not conform
to its Program Specifications, IBM will 1) attempt to make the Program operate as warranted a) if
prior to the Service Expiration Date, by providing a correction, or b) if after the Service Expiration
Date, by providing any existing corrections, or 2) replace the Program with a functionally equivalent
Program, as determined by IBM. In the event that IBM does not provide such a remedy, you may
terminate your license and your money will be refunded upon return of all your copies of the
Program.
IBM does not warrant that any other defects in the Program will be corrected or that the operation of
the Program will be uninterrupted.
This limited warranty will apply only if the Program is licensed and located in the United States or
Puerto Rico.
THIS WARRANTY IS IN LIEU OF ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE.
Some states do not allow the exclusion of implied warranties, so the above exclusion may not apply to
you. This limited warranty gives you specific legal rights, and you may also have other rights which vary
from state to state.

* IBM is a trademark of the IBM Corporation.

ix

• PC DOS 7 provides user commands to perform the following functions:
-

Manage information by creating, assigning attributes to, copying,
comparing, renaming, listing, printing, erasing, replacing, moving, backing
up, restoring, recovering files, and rewriting fragmented files contiguously.
- Manage directories by creating, removing, modifying, copying, and
displaying the structure of directories.
- Format, unformat, copy, and compare diskettes.
- Format, partition, and check status of a disk.
- Perform system tasks, including:
- Assign drives
- Change the system code page and keyboard layout
- Clear the screen
- Set the system time and date
- Create a PC DOS 7 batch file to perform special or repetitive tasks.
- Configure your system for multiple configurations.
• Memory Support:
- Memory optimization of available upper memory.
- Expanded Memory Support (EMS) and Extended Memory Support (XMS).
This support conforms to the Lotus**/Intel**/Microsoft** (LIM) 4.0 definition.
• Disk Cache
PC DOS 7 provides an improved hard-disk caching program.
• Hard-Disk Support:
PC DOS 7 allows greater than 32MB fixed disk partition support.
• Advanced Power Management (APM)
PC DOS 7 supports the latest standard of APM 1.1 and continues to
support systems with APM 1.0 bios.
• Virus Detection and Antivirus Support
- Full-screen utility
- Terminate-and-stay-resident
- Updated signature files to detect over 2100 viruses
• Full-Featured Backup Utility
-

Provides a full-screen utility
Backs up to diskette, tape, or network drive

** See Special Notices section of this book for trademark information.

x

PC DOS User's Guide

• REstructured eXtended eXecutor language (REXX)
PC DOS 7 provides this easy-to-use structured programming language that:
- Offers powerful functions
- Provides extended mathematical capabilities
- Works across multiple platforms (WARP, AIX, VM, and PC DOS)
• Text Editor
PC DOS 7 provides a full-screen text editor that allows the end user to
create, edit, save, browse, and print ASCII files.
• Full-Screen DOS Interface (PC DOS Shell)
-

Provides a limited application switching mechanism which suspends
execution of one application while executing another.
Enables the creation of a user-defined menu system for the execution
of applications.
- Provides a full-screen user interface to facilitate DOS file and directory
maintenance.
• Full-Screen Interactive Installation Program
- Installs all PC DOS 7 utilities and optional tools.
- Creates user configuration files.
Instal,ls to a new system or replaces an existing system.
• Scheduler Utility
- Allows execution of DOS programs at specific times.
- Provides a full-screen, easy-to-use interface.
• Data Compression Utility
- Automatic, transparent data compression that frees up storage space.
- A Stacker Anywhere program, allowing you to use compressed data on
a system without compression.
- A conversion function for DBLSPACE compressed files.
- DOS and Windows toolbox interfaces.
Automated uncompress to convert compressed data to its original form.
• Docking Support
PC DOS 7 provides the ability to dynamically load certain device drivers
and to execute specified commands when docking events occur.
• File Sychronization Utility
PC DOS 7 provides a file monitoring utility that synchronizes files whenever
files are moved from one computer to another.

xi

• PCMCIA Support
PC DOS 7 includes PCM 3.01 support for PCMCIA card services.
• Documentation Viewing Facility
PC DOS 7 provides a text-based, full-screen, online documentation and
help facility. This viewer can be used to read the following books
online: PC DOS 7 Command Reference, PC DOS 7 Error Messages, and
PC DOS 7 REXX for DOS.
• National Language Support
-

Code pages 865, 912, and 915
Keyboards 452 and 453 (German keyboard layout DIN 2137)

Deleted Files
The following files were deleted from this version of PC DOS 7:
4201.CPI
4208.CPI
COMP.COM
EDLlN.EXE

EPS.CPI
EXE2BIN.EXE
FASTOPEN.EXE
GRAPHICS.COM

GRAPHICS.PRO
PPDS.CPI
PRINTER.SYS

If you have a licensed copy of PC DOS 6.3, you are authorized to copy these
commands to any system with a licensed copy of PC DOS 7.

System Requirements
. PC DOS 7 will operate on all models of Personal System/2*, Personal System/1,
IBM Personal System/55*, IBM Personal Computer*, IBM Personal Computer XI,
Personal Computer XT-286, Personal Computer AI, Portable Personal Computer,
PC Convertible, and IBM compatibles with a minimum system memory of 512K.
The system should also have a 1.44MB or 2.88MB 3.5-inch, or a 1.2MB 5.25-inch
floppy diskette drive. The PC DOS 7 Upgrade requires a system with a prior
version oi PC DOS or MS-DOS" (3.3 or higher) installed on the haid disk.

Program Requirements
There are no program requirements.

Licensed Program Materials Availability
This licensed program is available in object code only.

* Trademarks of the IBM Corporation.

xii

PC DOS User's Guide

Contents
About This Book

xix
xix
xx

Other PC DOS Documentation
PC DOS 7 Coupon Booklet . . . .

What's New for PC DOS 7

xxi

Part 1. Using the DOS Operating System
Chapter 1. Installing

.............. .

What's New about Setup for PC DOS 7
Before You Begin . . . . . . . . . . . .
SETUP Command and Its Options ..
Other Installation Options . . . . . . .
Optional Tools Selection . . . . . . . .
Installation Guidelines . . . . .
PC DOS Standard Installation

. .
\

Chapter 2. Learning Basic DOS Concepts

19
19

Understanding Files . . . . . . . . . . . . . .
Working with Files . . . . . . . . . . . . . . .
Understanding and Working with Directories ..
Viewing Directory Contents . . . . . . . . . . . .
Viewing Groups of File Names in a Directory
Making Directories
. . . . .
Deleting Directories
. . . . .
Copying Directories
. . . . .

23
32
34
35
35
36
38

Chapter 3. Using the Online Book Viewer . .

41
41

Starting the PC DOS Viewer . . . . . . . . . . .
Viewing the Initial PC DOS Viewer Screen .. .
Moving Around in the PC DOS Viewer
Exiting from the PC DOS Viewer ...
Getting Other Types of Online Help
Linking to More Topics . . . . . . . . .
Printing from the PC DOS Viewer
Copying Topic Information into a File

Chapter 4. Configuring Your System

43
44
45
45

49
51
51

...... .

Bypassing CONFIG.SYS and AUTOEXEC.BAT Commands
Specifying Startup Commands in Your CONFIG.SYS File . . . . . .
© Copyright IBM Corp. 1981, 1995

3
3
5
8
9
10
12
14

53
54

56

xiii

Using Multiple Configurations . . . . . . . . . . . . . . . . . . .
Specifying Startup Commands in Your AUTOEXEC.BAT File

60
66

Chapter 5. Managing Disks
Types of Disks . . . . . . . .
Types of Diskette Drives
Considerations for Formatting Disks
Considerations for Labeling a Disk .

73
73
74
75
79

Chapter 6. Partitioning Your Hard Disk
Understanding Hard-Disk Partitions
Using FDISK . . . . . . . . . . . . . . . . .
Formatting Your Hard Disk after Using FDISK

81
81
83
94
...

Chapter 7. Working with Batch Programs
Understanding Batch Program Commands
Making a Small Batch Program . . . . . . .
Testing a Batch Program . . . . . . . . . .
Displaying Messages with a Batch Program
Using the PAUSE Command . . . . . . . .
Including Remarks in a Batch Program
Running One Batch Program from Another .
Using Replaceable Parameters
Controlling Program Flow . . . . . . . . . . .
Chapter 8. Redirecting Input and Output
Redirecting Command Input and Output
Passing Information through Filter Commands
Controlling the Screen Display by Using the MORE Command
Searching for Text by Using the FIND Command
Sorting Text Files . . . . . . . . . . . . . . . . . . . .
Combining Commands with Redirection Characters

109
109
111
111
112
112
113

Chapter 9. Using DOSKey and Editing Keys
Using DOS Key to Work with Commands
Using DOS Key to Work with Macros
........ .
Using DOS Editing. Keys

115
115
120
127

Chapter 10. Working with the Text Editor
What's New about the E Editor for PC DOS 7
Choosing a Text Editor
....... .
Starting the E Editor . . . . . . . . . .
Creating or Modifying a File . . . . . .

xiv

97
98
100
101
101
102
103
104
105
106

PC DOS User's Guide

..

131
131
132
133
137

Using Cursor Movement Keys to Move Around in the Text File
Performing Basic Editing Tasks
",','"
Selecting Text , , , , , , , , , , , , , , , , , , ,
Using Key Combinations to Manipulate Text
Using E Editor Commands , , " ' , ' , ' "
Customizing the E Editor , " , " , " , "
Comparing a Text Editor and a Word Processing Program

· ......
•

I

I

• • • • • •

• • • • •

......

141
143
148
151
156
169
172

Chapter 11. Connecting Computers " ' "
Establishing the Connection between Computers
Understanding What the InterLnk Program Does
Including INTERLNK in Your CONFIG,SYS File
Running the InterLnk Program
Redirecting Drives " ' , , " ' , ' , " ' , '
Excluding Drives from Redirection , , " ' , '
Breaking the Connection between Computers
Remote Copying of INTERSVR.EXE and INTERLNK.EXE Files
Reviewing Cable Specifications
,.,"

175
176
177
180
181
182
183
183
183
184

Chapter 12. Using File Update " , ' ,
Installing File Update at the Base Location ,
,,""
Using File Update Menu Choices
Transferring Updated Files to the Remote Location
Troubleshooting , " ' , ' , " , " , " , ' "

189
190
194
196
203

· .......
· .......
,

Chapter 13. Making More Memory Available
Determining Your System's Memory Type
Understanding How RAM Boost Works
Using Advanced Features , " , " , " , '
Using RAM Boost Tips and Techniques

205
205
206
214
218

Chapter 14. Speeding Up Your System
Improving the Efficiency of Your Hard Disk
Using DOS Defragmenter , " ' , ' , "
Using the BUFFERS Command
"'"
Using SMARTDrive ,
, , , , ,
Using RAMDrive " , " , ' /, , , , , , ,

231
231
233
235
236
238

Chapter 15. Using Central Point Undelete
Installing Central Point Undelete for Windows
, , , , , , ,
Starting Undelete " ' "
Deleted File Condition "
, , , , , ,
Delete Protection Methods

241
241
243
245
247
Contents

XV

Getting More File Information.
. ......... .
. . . . . . . . . . .
Sorting the File List . . . . . . .
Selecting Files
.........
. . . . . . . . . . .
Undeleting Files on a Network . . . . . . . . . .
Undeleting Directories and Their Files' . . . . . .
Scanning the Disk for Lost Files and Deleted Data
Showing Existing Files ....
Advanced Undelete Methods . . . . . . . . . . . .
Purging Deleted Files . . . . . . . . . . . . . . . .
How the Delete Protection Method Affects File Recovery
Central Point Data Monitor . '. . . . . . . . . . . . . . . .

248
248
249
251
252
258

Chapter 16. Using Central Point Scheduler .
Scheduling a Program . . . . . . . . .
Editing Existing Scheduled Events
Deleting Scheduled Events
Removing Scheduler from Memory

275
275
278
279

Chapter 17. Troubleshooting
PC DOS Installation
Memory Problems
DOS Command Problems
PC DOS Shell . . . . .
AntiVirus . . . . . . . .
Stacker Compression
Central Point Backup
File Update Utility . . .
Other Common Problems ...

281
281
287
292
295
297
299
312
313
313

Part 2. Using the DOS Optional Tools
Chapter 18. Using the PC DOS Sheil . . . . . . . .
Installing the PC DOS Shell after Installing PC DOS
Starting the PC DOS Shell . . . . . . . . . . . . . . .
Displaying Information About Your Files and Programs
Introducing PC DOS Shell Basics
..... .
Using PC DOS Shell Commands
Getting Help . . . . . . .
Starting a Program .... .
Using the Task Swapper
Leaving the PC DOS Shell
Customizing the PC DOS Shell
Organizing Programs
.....

xvi

PC DOS User's Guide

260
261

266
267
270

280

317

3i9
319

320
323
324
333
334
338
341
342
343
348

Working with Properties

353

......... .

Chapter 19. Using IBM AntiVirus/DOS
Installing IBM AntiVirus/DOS after Installing PC DOS .
Starting IBM AntiVirus/DOS . . . . . . . . . . . .
Protecting Your Computer Data against Viruses
Checking for Viruses . . . . . . . . . . .
Customizing AntiVirus . . . . . . . . . . . . .
Cleaning Up When a Virus Is Detected . . . . .
Running the AntiVirus Stand-Alone Program ..
Systems that Use Resident Data Compression
Systems that Use Security Software
Troubleshooting IBM AntiVirus/DOS . . . .

363
363
365
367
369
372
376
379
381
382
382

Chapter 20. Using Central Point Backup
Installing Central Point Backup after Installing PC DOS
Configuring Central Point Backup . . . . . . . . .
Viewing the Main Central Point Backup Window .
Changing the User Level
Making a Backup . . . . . .
Selecting Files
...... .
Selecting Drives to Back Up
Viewing Files . . . . . . .
Working with Setup Files
Comparing Data
.... .
Restoring Data . . . . . .
Performing Network Backups
Configuring Tape Drives .. .
Backup Strategies .... .
Using the CPBDIR Program

383
383
384
388
389
391
394
400
402
403
407
409
411
415
421
425

Chapter 21. Using Stacker Compression
Installing Stacker after Installing PC DOS
Before Using Stacker
........... .
What's New about PC DOS's Stacker Compression
Settill9 Up Stacker . . . . . . . . . . . . . . .
Monitoring Your Drives from DOS . . . . . .
Using the Stacker Tools (DOS and Windows)
Compressing Additional Drives . . . . . . . .
Compressing Diskettes (or Other Removables)
Working with Advanced Stacker
Using Stacker Commands . . . . . . .
Monitoring Your Drives from Windows

427
427
428
429
430
438
440
440
442
455
467
469
Contents

xvii

Troubleshooting Stacker ...

Chapter 22. Using PenDOS
Installing PenDOS afterlnstalling PC DOS
Starting PenDOS . . . . .
Using the Pen . . . . . . .
Using the Mouse as a Pen
Using the PenDOS Menu
Entering Characters
Editing Characters
Working with Applications
Aligning the Tablet .
, Recognition Tips
Character Variations

xviii

479
481
481
483
484
484
485
486
490
493
497
498
499

Chapter 23. Using PCMCIA Support
Installing Phoenix PCMCIA Support after Installing PC DOS
Starting PCMCIA . . . . . . . . . . . . . . . . . . .
Setting Up PCMCIA (PCMDINST) . . . . . . . . . .
Configuring Your PCMCIA System (PCMSETUP)
Configuring PCMCIA . . . . . . . . . . . . . . . . . .
Using Advanced Configuration . . . . . . . . . . . .
Configuring PC Cards after the Original Installation

501
502
503
505
505
512
517
524

Appendix A. More About Installing . . . . . . . .
Choosing the Correct Installation Procedure
Performing the LAN Server Administrator Installation of PC DOS
........ .
Installing PC DOS from a CD-ROM Drive
Rerunning Setup . . . . . . . . . . . . . . . . . . . . . . . .
Uninstalling and Restoring Your Previous Version of DOS
Viewing and Editing the System Files during Install
Viewing the README.TXT File ....... .
Working with XDF-Formatted Diskettes
Working with Setup Bundle Files ...
Using the Emergency Startup Diskette
Troubleshooting PC DOS Setup ...

533
533

540
544
544
547
548
550
550
554
555
556

Appendix B. Accessibility for Individuals with Disabilities

557

Appendix C. Notices . . . . .
Trademarks and Service Marks

561
561

Index . . . . . . . .

565

PC DOS User's Guide

About This Book
This book is written for novice users or users who are already familiar with
PC DOS and who have experience using computers.
This book is organized into two parts. Part 1 contains instructions for use with the
fundamental PC DOS features. Part 2 contains information on the Optional Tools
available with PC DOS.
If PC DOS is not yet installed on your computer system, you will need to run the
Setup program. For information about how to set up PC DOS, see Chapter 1,
"Installing" on page 3.

Other PC DOS Documentation
The PC DOS library includes the following documentation:
• .PC DOS 7 Command Reference and Error Messages
Part 1 of this book contains the commands, listed in alphabetical order, that can
be typed from the DOS command prompt. It also includes information on DOS
device drivers, CONFIG.SYS commands, menu configuration commands, REXX
commands for DOS, and .INI file information. Part 2 includes error messages
in a cause-and-action format.
• Online books are provided with PC DOS containing the same information as is
available in the PC DOS 7 Command Reference and Error Messages
hardcopy manual. The three online books provided with PC DOS include:
- PC DOS 7 Command Reference
- PC DOS 7 Error Messages
- PC DOS 7 REXX Reference
• PC DOS 7 Keyboards and Code Pages
This book, available for optional purchase, contains examples of keyboard
layouts and code page tables that can be used with PC DOS~
• PC DOS 7 Technical Update
This book, available for optional purchase, is written for programmers who'
develop applications for DOS.
Included with the hardcopy version of this book is a diskette, containing the
online version, which is viewable using the PC DOS Viewer.

© Copyright IBM Corp. 1981, 1995

xix

• PC DOS 7 REXX User's Guide and Reference
This book, available for optional purchase, describes' how to write programs
with REXX and is for both beginners and experienced programmers.

PC DOS 7 Coupon Booklet
This booklet contains coupons provided by major hardware and software computer
companies. These coupons offer discounts or information about their products.

xx

PC DOS User's Guide

What's New for PC DOS 7
PC DOS 7 includes the following new features as well as enhancements to
features in prior versions of PC DOS:
• The PC DOS Setup program includes enhancements that allow you to:
- Use a mouse device during installation.
-

Use the DOSKey program immediately after installing DOS, because the.
DOSKEY command-line statement is now automatically added to your
AUTOEXEC.BAT file.

- View or edit the changes Setup made to your CONFIG.SYS and
AUTOEXEC.BAT files prior to system restart. For example, if you use
another command retrieval program than DOSKEY, you can edit the
AUTOEXEC.BAT file and delete this command-line statement before the
Setup changes become effective.
- Understand what changes were made to these system files by reviewing
comment lines added by Setup. Comment lines describe what was added
in these files or what was replaced, updated, or deleted if upgrading your
version of DOS.
See the installation information for

a complete list of Setup enhancements.

• RAM Boost more effectively handles multiple configurations now. The most
common questions asked about RAM Boost and RAM Boost Setup are now
included in a tips and techniques section.
• The E Editor has the following enhancements for PC DOS 7: menu selection,
mouse awareness, expanded sort capabilities, deleted record recovery, ability
to change E Editor default settings for color, tab and margin settings, window
mode, and new browse mode for the online F1 help.

a

• A new program, File Update, compares files on two different computers to help
keep files sychronized (for example, when you work on one computer at home
and one at work).
• A new documentation viewer, PC DOS Viewer, is used to read or search online
books for PC DOS information. Three online books are included with
PC DOS: a Command Reference, a REXX Reference, and an Error
Messages book, which includes the more common error messages.
This viewer also allows quick access to help for DOS commands, DOS device
drivers, and DOS .INI files information. In addition you can get quick help for
REXX commands or DOS error message~.

© Copyright IBM Corp. 1981, 1995

xxi

• The enhanced Advanced Power Management driver (POWER.EXE) has added
power management events.
.• PC DOS now provides support for a docking event. Docking is the process of
connecting a mobile computer to a docking station and subsequently accessing
the additional docking station system resources (for example, CD-ROM or
DASD). Your docking station and mobile computer must be plug-and-play
enabled to perform the docking and undocking events.
• The new PC DOS command, DYNALOAD, can be used to change the current
system device configuration without requiring you to modify the CONFIG.SYS
file and restart the system, such as for docking support.
• The amount of conventional memory required by PC DOS has been reduced,
allowing more memory for your applications.
• The QCONFIG command now identifies and displays additional machines,
adapters, and planars.
• The BACKUP command (not included in PC DOS versions 6.1 or 6.3) is
provided as a command with PC DOS 7 ..

New, Changed, or ~emoved PC DOS Commands and Device Drivers
The following commands and device drivers are new for PC DOS 7:
ACALC
BROWSE
CHECK
CNFIGNAM.EXE
CONFIG
CRC
CREATE
DCONVERT
DDPOPUP
DOSDATA
DOS DOCK

DPMS.EXE
DYNALOAD
FILEUP
HCONVERT
PASSWD·
PCM
PCMDINST
PCMFDISK
PCMRMAN
PCMSETUP
PCMWIN

REMOVDRV
REPORT
RESIZE
REXX
SCREATE.SYS
SDEFRAG
SDIR
SETUP (Stacker)
SGROUP
SSETUP
STAC

STACHIGH.SYS
STACKER
STACWIN
SYSINFO
TUNER
UNCOMP
UNPACK2
VIEW
XDF
XDFCOPY

The following commands and device drivers are enhanced for PC DOS 7:
ANSI.SYS
BUFFERS
DEFRAG
DISKCOPY
DISPLAY.SYS

DOSKEY
E (E Editor)
EMM386.EXE
FIND
HELP

HIMEM.SYS
INTERLNK
MSCDEX
POWER
QCONFIG

RAM BOOST
RAMBOOST.EXE
RAMDRIVE.SYS
RAMSETUP
SETUP
SMARTDRV.EXE

. For further information about new or enhanced DOS commands and device drivers,
type hel p followed by the name of the command or device driver.

xxii

PC DOS User's Guide

You must add the extension of the device driver file. For example, you would type
hel p ansi. sys to get online help about the ANSI.SYS device driver.
The following commands and device drivers are no longer provided with
PC DOS 7:
• SuperStor/OS compression commands.
DBLSPACE.SYS
MOUNT
RTOOL
SSTOR
SSUNCOMP

SSUTIL
UDEOFF
UDEON
UNMOUNT

• PCMCIA Support commands replaced because of the new DOS and Windows
full-screen installation interfaces.
PCMFDD.EXE
PCMINFO.EXE

PCMMTD.EXE
WPCMINFO.CPL

If you have a previous version of DOS installed and are upgrading your system,
these commands will not be removed during PC DOS installation.
• Infrequently used files or commands that are not being provided as part of
PC OOS~.
4201.CPI
4208.CPI
COMP.COM
EDLlN.EXE
EPS.CPI
EXE2BIN.EXE

FASTOPEN.EXE
GRAPHICS.COM
GRAPHICS.PRO
PPDS.CPI
PRINTER.SYS

-

If you have a previous version of DOS installed and are upgrading your
system, these commands will not be removed during PC DOS installation.

-

If you still want to use these commands and have no diskettes from
previous versions of DOS, these commands will be available through
electronic delivery, such as bulletin board services.

-

If you have a licensed copy of PC DOS 6.3, you are authorized to copy
these files that are not provided to any system with a licensed copy of
PC DOS 7.

-

If you use these commands with PC DOS 7, first you must use the
SETVERcommand to change the version.

What's New for PC DOS 7

xxiii

• Commands no longer provided by PC DOS.

EXPAND
MEUTOINI
RECOVER
If you have a previous version of DOS installed and are upgrading your system,
these commands will not be removed during PC DOS installation.

New, Changed, or Removed Optional Tools

,

The new features of, and enhancements to, the optional tools provided with
PC DOS include:
• REXX Language Support has been added as the PC DOS programming
language tool of choice. REXX for DOS includes utilities and REXX commands
that have been designed to work specifically with PC DOS.
• Stacker Compression is now the optional tool that provides data compression
for your system. If you are upgrading from PC DOS 6.1 or 6.3, SuperStor/DS
will not be removed from your system during installation.
Stacker Compression allows you to: .
-

Convert any existing SuperStor/DS, DoubleSpace, or DriveSpace
compression during Stacker Setup.

- Convert most stand-alone versions of Stacker Compression you might
already have installed.
-

Make menu selections using either the Stacker DOS Toolbox or the Stacker
Windows Toolbox.

-

Use data on compressed diskettes even on a computer that does not have
Stacker installed.

-

Guard your data because, every time you start up your system, Stacker
runs AutoProtect to make sure vour data is in aood condition.
.

J

~

• PCMCIA Support now provides easier Setup procedures through new DOS and
Windows full-screen interfaces included with PC DOS 7. The PCM.INI file is
updated for you as you use the PCMCIA installation program to make
selections for the type of PCMCIA support you want.
• Antivirus protection provided with PC DOS (AntiVirus or IaM AntiVirus for
Windows), has been updated to recognize and fix more viruses.

xxiv

PC DOS User's Guide

If you are using IBM AntiVirus Services, a full-service, antivirus protection
offering provided separately by IBM or if you have previously purchased the
IBM AntiVirus/DOS product separately, you do not need to install the IBM
AntiVirus/DOS optional tool provided with PC DOS. For more information
about IBM AntiVirus Services, refer to the coupon provided in the PC DOS 7
coupon booklet.
• IBM DOS Shell is now named the PC DOS Shell.

New, Changed, or Removed .INI Files
The following .INI files have been added, changed, or are no longer required for
PC DOS 7:
New

Changed

Removed

E.INI
PCM.INI
RAMSETUP.INI
STACKER.INI

RAMBOOST.INI

ADDSTOR.INI
DBLSPACE.INI

New, Changed, or Removed Keyboard Layouts and Code Pages
The following keyboards and code pages have been added or changed for
PC DOS 7:
452
453
865
912
915

keyboard
keyboard (provides the DIN 2137 German keyboard layout)
code page
code page
code page

The United Kingdom keyboard 168 has been removed.
Type help keyb to see a table that summarizes all the keyboard-layout and country
code-page information.

What's New for PC DOS 7

XXV

xxvi

PC DOS User's Guide

Part 1. Using the DOS Operating System

Chapter 1. Installing

............ .

. 3

Chapter 2. Learning Basic DOS Concepts

19

Chapter 3. Using the Online Book Viewer

41

Chapter 4. Configuring Your System ...

53

Chapter 5. Managing Disks

73

Chapter 6. Partitioning Your Hard Disk

81

Chapter 7. Working with Batch Programs

97

Chapter 8. Redirecting Input and Output

109

Chapter 9. USing DOSKey and Editing Keys

115

Chapter 10. Working with the Text Editor

131

Chapter 11. Connecting Computers

175

Chapter 12. Using File Update . . . . . . . . . . . . . . . . . . . . . . .

189

Chapter 13. Making More Memory Available

205

Chapter 14. Speeding Up Your System

· ........
•

••

I

• • • • •

231

Chapter 15. Using Central Point Undelete

· ........

241

Chapter 16. Using Central Point Scheduler

· ........

275

· ........

281

Chapter 17. Troubleshooting

© Copyright IBM Corp. 1981, 1995

.........

1

2

PC DOS User's Guide

Chapter 1. Installing
This chapter provides what you need to know to perform a standard installation of
PC DOS 7 (PC DOS) on your computer system. A standard installation means
you are:
• Installing PC DOS on your existing hard disk over another version of DOS
(such as MS-DOS** or earlier versions of PC DOS).
• Installing PC DOS on a newly formatted and partitioned hard disk (also see
page 83 for partitioning information).
• Installing PC DOS on a new computer system that does not have any type of
operating system installed.
Special installation procedures might be required because of the software or
hardware you are using with your computer system. These procedures can be
found in the appendix 'of this guide. Or, you can review the installation guidelines
(Table 2 on page 13). This table helps you choose the installation information that
pertains to your system. Read the specific information that applies to your system
before beginning the install process to ensure a successful installation.

What's New about Setup for PC DOS 7
The PC DOS Setup program (Setup) includes unique features not found in previous
versions of DOS. Review this abbreviated description of enhancements before
beginning the installation. Complete information regarding these enhancements is
described elsewhere in this chapter or in the installation information in the appendix.
• Diskettes used for PC DOS installation (other than the Setup diskette) have
been specially formatted using a format process known as eXtended Density
Format** (XDF**). XDF extends the capacity of the diskettes.
This special format does not affect running Setup. The Setup program is
specifically designed to use XDF-formatted diskettes.

• The Setup Diskette runs the Setup program file (SETUP) and also serves as an
emergency startup diskette to start your computer system. This diskette is not
XDF-formatted; its format is a standard DOS format.
• There is a new command, the XDFCOPY command. The purpose of this new
command is to allow you to make backup, copies of all your PC DOS

**
**

MS-DOS is a trademark of the Microsoft Corporation.
XDF and eXtended Density Format are trademarks of Ametron, Inc.

© Copyright IBM Corp. 1981, 1995

3

XDF-formatted installation diskettes. If you need to copy your Setup Diskette or
any standard-formatted diskette, continue to use the DISKCOPY command as
you always have.
• PC DOS Setup files are now packed together in what is known as a bundle file.
If you need a copy of a file from the PC DOS installation diskettes, the
recommended method is to rerun Setup because Setup unpacks and copies
files in one step. The EXPAND command is no longer needed or supported.
• Because XDF-formatted diskettes are different than standard DOS-formatted
diskettes, some DOS commands are affected by this format:
-

Certain DOS commands only work with XDF-formatted diskettes (XDF and
XDFCOPY).

-

Some DOS commands can be used on the XDF-formatted diskettes but
only under specific circumstances (DIR and FORMAT).

-

Certain DOS commands cannot be used with XDF-formatted diskettes
(DISKCOPY and DISKCOMP).

Refer to "Working with XDF-Formatted Diskettes" on page 550 or the online
PC DOS 7 Command Reference for specifics about using these commands
with XDF-formatted diskettes.
• If you already have a mouse device attached and loaded, PC DOS Setup will
provide mouse support during installation for making selections.
• Comment lines are added to your system files (AUTOEXEC.BAT and
CONFIG.SYS) to identify the changes PC DOS Setup made. Set~p identifies
the lines in the files that were added, deleted, replaced, and updated. If
deleting, replacing, or updating a line, it includes the original statement on the
comment line for reference.
I

• New switches have been added to the SETUP command:
- The

Ie switch allows you, after installation has completed, to remove the

- The Iq switch provides the easiest method for making keyboard layout and
country code changes.
• Setup renumbers the backup versions for each of the two system files
(AUTOEXEC.BAT and CONFIG.SYS) wheneveryou run or rerun SETUP. Both
files are renur;nbered to the identical file extension number, but the highest
number might not be the latest backup version.

4

PC DOS User's Guide

Before You Begin
Before installing, take a few minutes to review the questions that follow before you
actually begin the installation.
•
•
•
•
•

Do you have enough conventional memory to install DOS?
Do you have enough free space to install DOS?
Do you have the correct required hardware?
Which installation procedure should you use?
Should you be using a SETUP command parameter to install?

To find out the answers to these questions, you should read the information in the
following sections before proceeding to "PC DOS Standard Installation" on
page 14.

Hardware and Software Prerequisites
PC DOS operates on all IBM or IBM-compatible computers with at least 512K of
conventional memory. As a minimum, you must have a computer that has a
1.44MB-capacity, 3.5-inch diskette drive or a 1.2MB-capacity, 5.25-inch diskette
drive specified as .drive A. Your hard drive should have a minimum of 6.0MB of
free space to install only the DOS files and Central Point Backup** for DOS.
18.5MB of free space is needed if you want to install PC DOS plus all the optional
tools.
If upgrading from a previous version of DOS, keep the following things in mind:

• You can upgrade only DOS Version 3.3 or higher.
• You can upgrade only a FAT-formatted hard disk.
• You might want to back up and save your previous version of DOS (see
"Uninstalling and Restoring Your Previous Version of DOS" on page 547).

Mouse Support during Setup
PC DOS allows you the option of using a mouse during installation if you have a
mouse program loaded.
Click mouse button 1 (normally the left mouse button) once to make an option
selection, choose a function key, or toggle choices from NO to YES in the optional
tools list.
Note: The only time mouse support would not be available during Setup is if you
need to boot the system using the Setup Diskette (also known as the
emergency startup diskette) from the PC DOS installation diskettes.

** Central Point and Central Point Backup are trademarks of Central Point Software, Inc.
Chapter 1. Installing

5

If all the selections you can make are not visible at one time in a window, you will
see the word "More" and an arrow in brackets (for example, [More t]) at the top or
bottom of the window to indicate there is additional information that cannot be seen
in the window. Click on the arrow to see more choices.

Changes Made by Setup to the AUTOEXEC.BAT and CONFIG.SYS
Files
Setup modifies your AUTOEXEC.BAT file and your CONFIG.SYS file. Optionally,
you can make additional changes to the system files yourself during installation.
What modifications Setup makes to your system files depend on whether or not you
already have a version of DOS or PC DOS installed on your system.
If you have a previous version (rerunning Setup or upgrading) of DOS:
The following are the changes that PC DOS Setup makes to these files.
• Backing up your current system files as AUTOEXEC.nnn or as CONFIG.nnn,
where nnn is the next highest incremental number between 000 and 999. Even
if only one of the system files is changed, both the AUTOEXEQ.BAT and the
CONFIG.SYS files are given the same incremental number so they can be
easily identified as corresponding pairs.
For example, if you have both a CONFIG.003 file and a CONFIG.005, file (and
because CONFIG.005 is currently the highest incremental number), the next file
extension number would be CONFIG.006 instead of CONFIG.004.
• Verifying that all the required lines are included in the system files and, if not,
adding them.
For example, if you selected an optional tool requiring a command-line
statement, the appropriate statement will be added.
• Updating DOS programs with new programs that perform the same function
(see "What's New for PC DOS 7" on page xxi).
• Removing obsolete DOS programs, if necessary.
• Preserving existing DEVICE and INSTALL command-line statements in the
CONFIG.SYS file, even if you have multiple configurations for system startup.
• Detecting if Microsoft** Windows** is installed, and making appropriate changes
to the Windows .INI files, such as SYSTEM.INI, PROGMAN.INI, and WIN.INI
files. Also, saving a backup version of these files with a file name extension of
.BAK.

**

6

Windows and Microsoft are trademarks of the Microsoft Corporation.
PC DOS User's Guide

• Adding one of the following four types of comment lines for each command-line
statement changed. The type of comment line added depends on how Setup
modified the comment-line statement:

REM
REM
REM
REM

=====
=====
=====
=====

PC
PC
PC
PC

DOS
DOS
DOS
DOS

7.0
7.0
7.0
7.0

-

Add
Delete
original_statement
Replace ===== original_statement
Update ===== original_statement

When Setup updates, deletes, or replaces a command-line statement, the
original statement is placed on the comment line for reference. Edit these files
if you want to return the command-line statement to how it was originally.
To view or edit changes made to your system files, answer YES when queried
, during Setup. Refer to "Viewing and Editing the System Files during Install" on
page 548.
After completing Setup, you can remove all the comments added by Setup at
the same time. Any command-line statements where you added the REM
statement will not be removed.
To remove the PC DOS 7.0 REM comments (after the installation has
completed), insert the Setup Diskette into drive A and type the following at the
DOS command prompt:

a:setup Ic
If you do not have a previous version of DOS:
Setup will create system files if they do not already exist.
A minimum CONFIG.SYS configuration is created that includes:
•
•
•
•

Adding
Adding
Adding
Adding

a
a
a
a

HIMEM.SYS statement
FILES statement with at least 30 files.
BUFFERS statement with at least 10 buffers.
SETVER statement.

A minimum AUTOEXEC.BAT file configuration is created that includes:
• Creating a path statement for the DOS directory.
• Adding the DOSKey program, which allows you to view, edit and carry out DOS
commands you used previously.

Chapter 1. Installing

7

SETUP Command and Its Options
The SETUP command is used when you are installing the latest version of
PC DOS. Insert the Setup Diskette into your drive. Then, to see the syntax and a
brief explanation of this command online, type a: setup /? (if drive A is your
diskette drive) at the DOS command prompt.
After installing PC DOS,' if you still need further details about the SETUP command,
type he~ p setup at the DOS command prompt.

Command Syntax
The following syntax shows the options that can be used with the SETUP
command:

drive: setup[!a][!b][!e][!e][/p][/q][!t:filepath][/u][/w]
or
drive: setup [I?]
Note: Setup does not copy the SETUP progra.m file to your hard drive. To use
this command or any of the SETUP command parameters, you must first
. insert the Setup Diskette from the PC DOS installation diskettes into the
diskette drive you install from.

Command Parameters
The following list provides a brief explanation of how each switch can be used with
the SETUP command.

drive:

Specifies the drive where you insert the Setup Diskette that contains
the SETUP program. If you change to the diskette drive, this
parameter is not needed.

la

Allows you to specify which type of LAN Server Administrator directory
files and tools. See "Performing the LAN Server Administrator
Installation of PC DOS" on page 540 for detailed information.

8

Ib

Specifies to use black and white instead of color screen display.

Ie

Removes comment lines from your'AUTOEXEC.BAT and
CONFIG.SYS system files placed there by Setup. This switch is used
after installation has been completed.

PC DOS User's Guide

/e

Installs only the files needed for the PC DOS optional tools you
select. DOS files are not recopied when you use this switch.
Modifications are made to your AUTOEXEC.BAT and CONFIG.SYS
files, based on the tools you select.

/p

Installs PC DOS on a disk that might be incompatible with DOS.

/q

Allows you to change your keyboard and country selections without a
complete re-installation of PC DOS. Your AUTOEXEC.BAT and
CONFIG.SYS files are modified using this switch.

/t:filepath

Specifies the target path to copy DOS files to.

/U for Setup
Use to uninstall the current version of DOS. You must have backed
up your previous version to uninstall.

/w

Allows Windows tools to be installed even though a valid Windows
directory was not found.

/?

Displays the abbreviated online help. Insert the Setup Diskette into
your diskette drive and type a: setup /? (if, for example, your diskette
is inserted into drive A).

You can use more than one switch at one time. For example, you could type
a: setup / a /b to use a black and white display for a LAN administrator installation.
However, if you use the /t switch combined with SETUP fA (for example, if you
typed setup /a /t:c:\pcdos7), Setup will default to creating an administrator
directory.

Other Installation Options
The PC DOS Setup program provides your system with the information it needs to
operate effectively. During the installation, PC DOS will prompt you to verify and
change information and then acts on your choices; you might be prompted to make
certain decisions, such as:
•
•
•
•
•
•
•

Do you want to change the current time and date?
Do you want to partition and format your hard disk?
What keyboard and country code page do you want to use?
Do you want ISO fonts?
Which optional tools do you want installed?
Where do you want to install DOS to?
Do you want to back up your previous version of DOS?

Chapter 1. Installing

9

• Where are your current DOS files located now (applies only when you are
upgrading your system)?
• Do you need to edit or view the changes made to your system files by Setup or
make your own additional changes to the system files (CONFIG.SYS and
AUTOEXEC.BAT)?
If you do not know the answers, just accept the choices that PC DOS installation
makes for you (called defaults)-except for optional tools.
Most of the optional tools are defaulted to NO, which means the tools will not be
installed; be sure to select the optional tools you want so the program files get
copied. To see all the tools, scroll to the top of the optional tools window.
Note: The selection of the PC DOS Central Point Backup for DOS optional tool
has already been defaulted to YES.
You can always rerun Setup later to add any optional tools you did not want to
install initially using the Ie switch (for example, typing a: setup Ie if installing from
drive A).

Optional Tools Selection
PC DOS includes the optional tools listed in Table 1 on page 11. During
installation, you are prompted to choose which ones you want on your system.
After you select the tools you want, Setup copies the required program files for the
selected tools to your DOS directory.
Certain optional tools must run their own installation program before they can be
used (for example; Stacker** Compression and PCMCIA** Support) because they
require certain user-specified information, which is obtained during program
installation. Before running the optional tool installation program, you should review
the installation information about each tool.
If you are upgrading your current version of DOS to PC DOS 7 and currently have
Windows installed on your computer, you will see additional optional tools just for
Windows.
If you do not currently have Windows installed, the Windows tools will not be
included in the list of optional tools. If you want to add the optional tools for

**
**

Stacker is a trademark of Stac Electronics.
PCMCIA is a trademark of the Personal Computer Memory Card International Association.

10

PC DOS User's Guide

Windows at a later time, install Windows first and then rerun Setup using the Ie
switch (see "Installing Additional DOS and Windows Optional Tools" on page 545).
Note: Installing Windows first ensures that the Windows .INI files are updated
properly.

Table 1 (Page 1 of 2). Optional Tools for DOS and Windows
Optional Tool:

What It Does:

Refer to:

PenDOS**

PenDOS allows the use of pen-based
applications and allows you to use the
mouse as the pen for applications (for
software and hardware prerequisites, see
"Installing PenDOS" on page 539).

Page 481

PC DOS Shell

Uses color and graphics to provide a
visual way of working with DOS.
Information is set up in different areas on
your screen, making it easy to find.

Page 319

Phoenix** PCMCIA
Support

Phoenix Personal Computer Memory Card
International Association (PCMCIA)
support provides support for PCMCIA
devices if your computer is equipped with
PCMCIA sockets. A credit card-sized
device is inserted into these sockets
extending the capability of the computer.

Page 501

Central Point
Undelete for
Windows

Central Point's Undelete for Windows is a
support utility for Windows if it is installed
on your computer.

Page 241

IBM AntiVirus/DOS
for Windows

IBM AntiVirus/DOS for Windows provides
support for Windows when using this tool
to protect your computer from viruses.

See page 367

IBM AntiVirus/DOS

IBM AntiVirus/DOS checks for computer
viruses on either your hard drives or
diskettes to prevent loss of data.

Page 363

REXX Language
Support

REXX is a simple yet powerful
programming language that can be used
by both beginners and experienced users
to write programs.

The online
PC DOS 7
Command
Reference

** PenDOS is a trademark of the Communication Intelligence Corporation.
** Phoenix is a trademark of Phoenix Technologies, Ltd.
Chapter 1. Installing

11

Table 1 (Page 2 of 2). Optional Tools for DOS and Windows

Optional Tool:

What It Does:

Refer to:

Stacker
Compression

Provides data compression utilities for
effectively and safely increasing the
amount of data you can store on your
hard drives and diskettes.

Page 427

Central Point
Backup for
Windows

Central Point Backup for Windows
provides support for Windows when using
this full-screen program to backup the
information on your computer.

See page 385

Central Point
Backup for DOS

Full-screen program for backing up the
information on your computer. Installed
as a default. If you do not want to install
or use Central Point Backup, be sure to
select NO on the optional tools screen.

. Page 383

Installation Guidelines
Before beginning the install:
• Check the installation guidelines that apply to your·system. See the Installation
Guidelines table, Table 2 on page 13.
• Make sure that your system has 512K of available memory. This is the
minimum amount of memory needed for PC DOS.
For additional information about the hard disk-space requirements, see
"Hardware and Software Prerequisites" on page 5.
• Read the introductory ·information earlier in this chapter, if you have not already
.done so.
• Be aware that this install is designed to replace all the existing DOS files
currently in the directory you install to. A file will be replaced if it has the same
file name as that being installed and if it already exists in the directory you
install to.

12

PC DOS User's Guide

The following table helps you choose the correct procedure for the type of
installation you want to do:
Table 2. Installation Guideline Choices

See page ...

Installation Guidelines
If you are installing PC DOS for the first time and you have. no other
systems on your computer
If you are installing PC DOS on a new hard disk, a newly formatted hard
disk, or a partitioned hard disk

*

14
14 and 83

If you are upgrading PC DOS on your hard disk

14

If you are installing PC DOS and you have Windows on your computer

14

If you are installing PC DOS files on a drive other than drive C

533

If you are installing PC DOS and you have OS/2* installed

534

If you want to use OS/2 Dual Boot (after installation)

535

If you are installing PC DOS on a PS/1 *

536

If you are installing PC DOS on a compressed drive

537

If you want to review prerequisites for PenDOS before installing

539

If you are a LAN Administrator responsible for installing PC DOS

202

If you are a LAN user and need to upgrade to PC DOS

543

If you want to install PC DOS from a CD-ROM

544

If you want to rerun Setup to add optional tools

545

If you need to uninstall PC DOS

547

If you want to view or edit the changes Setup made to your system files

548

If you need to view the PC DOS README. TXT file

550

If you need to work with XDF-formatted installation diskettes

550

If you are not installing on a hard disk but want to use some of the DOS
commands

555

If you have an installation problem

281

PS/1 and OS/2 are trademarks of the IBM Corporation.
Chapter 1. Installing

13

PC DOS Standard Installation
Setup installs PC DOS on drive C on the hard disk in your computer and makes
choices (installation defaults) for you. Most people wanting to install PC DOS will
want to use this standard installation procedure.

To install PC DOS:
1. If you do not currently have DOS installed on your system (booting from
diskettes) :

a. Insert the Setup Diskette into drive A.
b. Turn the power on (cold boot) for your computer or, if it is already powered
on, press CTRL+ALT +DEL (warm boot) to restart your computer.
c. Type Y to answer YES when queried whether you want to install
PC DOS 7.
If you currently have DOS installed on your system:

a. Turn on your computer and start your current system.
b. Insert the Setup Diskette into drive A or B.
Note: See the PC DOS README.TXT file for special instructions if you
have DR DOS currently installed on your system. The
README.TXT file can be found on the Setup Diskette.

c. Type either a: setup or b: setup, respectively, at the DOS command prompt.
2. After the PC DOS Welcome screen is displayed, press ENTER or click on
Cont i nue to continue following instructions on the screens.
A selection window is displayed that allows you to change the current time and
date, character set for the country, keyboard layout for the country, or the ISO
font (if you have a VGA or above display).
3. If you want to change these options:

a. Either use the UP ARROW and DOWN ARROW to scroll through the list, and
press ENTER for the list item you want to change while it is highlighted, or
use the mouse to make your change. (Each list item is highlighted as you
come to it.)
After making your selection, you are returned to the selection window.
b. Continue to scroll the screen making the changes you want.
c. After changing options, either use the DOWN ARROW to scroll to:

Options correct. Continue Setup.
and press ENTER, or click on this line if using a mouse.

14

PC DOS User's Guide

A selection window is displayed that lets you specify the optional tools you want
to install. (You will only see Windows optional tools, listed if Windows is
installed on your system before running Setup.)
Use the UP ARROW
or click here to see
additional tools.

Always select the same path
when rerunning Setup.

C DOS 7.0 Setup

PC DOS 1.0 offers NEW optional tools. Press Enter toal ernate
bet... ee YES and NO to select tools •. Arter selecting. Iii hlight
. . ' opt i 11S correct. Cont i llue Setup.' And press Enter to· c nt i nue.
139397 KB

[More fl
IBM AntiVirus/DOS
HE X Language Support
St cker Co~pression
C~ tral Point Backup for Windows
Ctntral Point Backup for DOS

1100
100
5500
3200
1300

D

Install to Path

I

](B
](B

](B
](B
](B

~~Q.
NO
NO
YES

C:'DOS

Press or click on these function keys.

Highlight and press ENTER
or click on this line after you
select tools.

Highlight and press
ENTER to change.

In order to have the files necessary for each optional tool copied to your hard
disk, you must change the selection choice from NO to YES for the selected
tool.
Note: Central Point Backup for DOS is defaulted to YES for you.

4. If you want to select any optional tools:
a. Use the UP ARROW and DOWN ARROW to scroll through the list of optional
tools. Each list item is highlighted as you come to it.
Note that other tools, such as PenDOS, might not be visible. If you see the
word "More" appearing at the top of the optional tools selection window,
either use the mouse and click on the rectangular bar or use the UP
ARROW to scroll to the top of the list.

Chapter 1. Installing

15

b. Either press ENTER, or click on the item using the mouse to select an
optional tool for your system. Note that pressing ENTER or, clicking on the
optional tool, toggles (changes back and forth) your choices from NO to
YES or YES to NO. The amount of available disk space is updated and
displayed on the screen as you select optional tools.
c. Co'ntinue to scroll the screen making the choices you want. When you
have finished, scroll to the

Options correct. Continue Setup.
line and press ENTER, or click on this line using your mouse.
A selection window is displayed that lets you change the path for your previous
DOS and Windows (if Windows is detected during installation) directories, if
necessary. Changing the path is only necessary if you are upgrading from a
previous version of DOS or Windows. Also, you can specify whether or not to
back up your previous version of DOS files.
5. Select one of the following:
• If you do not want to back up your previous version of DOS:
Make sure the option specifies NO, which is the default.
• If you want to back up your previous version of DOS:
Highlight the Back up previ ous DOS fi 1es line and press ENTER, or click on
the line if using a mouse, to change the option to specify YES. You will
need to have enough blank diskettes available to save your previous DOS
files.
6. When you have finished, either use the DOWN ARROW to scroll to the

Options correct. Continue Setup.
line and press ENTER, or click on this line using your mouse.
Follow the instructions on your screen until you have backed up all the files.
The actual number of diskettes depends on what version you are backing up
and the diskette density you elect to use.
7. Continue to follow the instructions on your screen and insert the remaining
installation diskettes in the order prompted. If you did not select all the optional
tools, you might not need to insert every diskette during installation.
Notice that, as Setup unpacks and copies files to the DOS directory, the file's
name is displayed at the bottom of your installation screen.

16

PC DOS User's Guide

Immediately before the PC DOS installation is finished, you are prompted
whether you want to view or edit the changes made by Setup and saved in
your AUTOEXEC.BAT and CONFIG.SYS files. Optionally, you can edit these
files yourself and modify the changes that Setup made.
8. When prompted whether to edit the changes in the system files, do one of the
following:
• If you do not want to view or edit the changes:

Make sure the Opti on correct. Conti nue Setup. line is highlighted and
press ENTER. Or, click on this line if using a mouse.
• If you want to view or edit the changes:

a. Use the UP ARROW to scroll to:

Edit AUTOEXEC.BAT and CONFIG.SYS changes?
and press ENTER, or click on this line if using a mouse, to change the
option to specify YES.
b. Use the DOWN ARROW to scroll to the line:

Option correct. Continue Setup.
and press ENTER, or click on this line if using a mouse. You can refer
to "Viewing and Editing the System Files during Install" on page 548 for
more complete instructions.
9. Follow the instructions on the screen until you are informed that the installation
has been completed and that your system will be rebooted.
System file changes only take effect following a system reboot. Be sure to
remove any diskettes from the diskette drive before pressing any key to reboot.
Notes for Installing:
• If you are making backup diskettes of your installation diskett~s:
Use the DISKCOPY command for the Setup Diskette and the XDFCOPY
command for all other diskettes.
• If you choose not to install every optional tool:
You may not be required to insert every diskette.
• If you have an error message occur during the installation process:
See "PC DOS Installation" on page 281. This section contains actions you can
take to resolve problems you might have while running Setup.

Chapter 1. Installing

17

• If you want to add any optional tools not installed initially at a later time:
You can use the Ie switch (see "Installing Additional DOS and Windows
Optional Tools" on page 545).
• If you have questions about any of the procedures or options:
Help is available by pressing the F1 key.
• If you install PC DOS over an existing version of DOS:
Setup updates your existing CONFIG.SYS and AUTOEXEC.BAT files and
saves the original files as CONFIG.nnn and AUTOEXEC.nnn.

18

PC DOS User's Guide

Chapter 2. Learning Basic DOS Concepts
The information that your computer uses is stored in files. To help you keep track
of your files, you can group your files into directories and subdirectories. To access
the data stored in your files, you must identify the drive and directory where DOS is
to search.
This chapter discusses a few of the basic concepts and terminology you need to
know to use DOS:
•
•
•
•
•
•

Files, file names, and extensions
Drives and current drives
Directories, current directories, subdirectories, and directory trees
Paths, full and relative
Wildcards
DOS command prompt

Understanding Files
The information your computer uses is stored in files. The instructions used to run
an application are stored in program files, and the information you create by using
an application is stored in data files.
As you work with an application, DOS processes the information stored in program
files and passes it along to your system when it is needed. When you are finished
using the application, you can save your data files on a hard disk (also referred to
as fixed disk) or on a diskette.
Every file has a name. Most files also have an extension. The file's name always
appears first, and the extension is separated from the name by period as in the
following example:

a

readme. txt
In this guide, a file's name and extension are jointly referred to as the file name.

© Copyright IBM Corp. 1981, 1995

19

File Names
The name you assign to a file must meet the following criteria:
• It can contain no more than eight characters.
• It can consist of the letters A through Z, the numbers 0 through 9, and the
following special characters:

$
%
@

underscore
dollar sign,
exclamation point
percent sign
hyphen
at sign
apostrophe

A

#

&

{}
()

caret
tilde
number sign
ampersand
braces
single quote
parentheses

Note: No other special characters are acceptable.
• The name cannot contain spaces, commas, backslashes, or periods (except the
period that separates the name from the extension).
• The name cannot be one of the following reserved file names: CLOCK$, CON,
AUX, COM1, COM2, COM3, COM4, LPT1, LPT2, LPT3, LPT4, NUL, and PRN.
• It cannot be the same name as another file within the directory.
File names are not case sensitive, so you can type the file name in either
uppercase, lowercase, or mixed case characters.

Extensions
Extensions can help you identify the type of information in a file. For example, if
you have a file called MINUTES.TXT, the extension .TXT usually identifies that it is
a text file; The extension must contain no more than three characters. File-name
restrictions regarding characters and spacing also apply to extensions.
The following are some of the extensions used by DOS:
• .EXE (executable) or .. COM (command) for files that contain programs.
• .BAT (batch or REXX) for files containing lists of commands that DOS carries
out consecutively.
• .INI (initialization) for files containing startup commands for an application.

20

PC DOS User's Guide

Current Drive
If you type a command at the DOS command prompt, commands will be carried out
on the drive you are currently working in unless you specify a different drive.
The drive you are currently working in is called the current drive. The letter of the
current drive is usually shown as part of the DOS command prompt (such as C: \> if
the current drive is C).
For example, suppose the current drive is drive A. To view a list of files on a
diskette in drive A, you would type the following:

dir
You do not need to type the drive letter to see the current drive.
To change the current drive, type the letter of the drive you want to change to,
followed by a colon. For example, suppose the current drive is C. To change the
current drive to drive A, type the following:

a:

Directories
To help you keep track of your files, you can group your files into directories. Just
as file folders in a file cabinet contain groups of related documents, directories can
contain groups of related files. Each directory can be assigned a unique name so
that you can identify it. For more information, see "Making. Directories" on page 35.
Sometimes you might want to further divide a directory to be more specific, or else
your directory might contain so many files that it is too confusing to find the one you
want. When this happens, you can use DOS to create additional directories. The
directory contained within another directory is called a subdirectory. This is similar
to placing a file folder within a larger file folder. A directory that contains another
directory is called the parent directory.
For more information about directory trees and how to view items in your directory,
see "Viewing Directory Contents" on page 34.

Paths
When you give the full path name for a file, you are stating a series of directory
. names that DOS follows before any actions are performed on that file. Each
directory name is separated by a backslash (\).

Chapter 2. Learning Basic DOS Concepts

21

Every file has its· own separate path. If you have two files with the same file name
but in different directories, DOS considers these to be two completely different files
because it considers the path and the file name to be the full file specification.
For example, C:\NOTES\AGENDA.DOC and C:\MEETING\AGENDA.DOC can have
files with the same file name, but the file contents can be different because their file
specification is different.
The following illustration shows the components that make up a path statement.
The path statement is limited to 127 characters.

L~rive [Di~,ectOry [S,~bdirectOry [ File
C: \OFFICE\MEETI NG\AGEN DA. DOC
~
y
J'
Root
Directory

~ Separators

You can specify a PATH command-line statement in your AUTOEXEC.BAT file.
The PATH command indicates which directories DOS is to search for executable
files. whenever you start your computer. When you designate more than one
directories, you must separate them with a semi-colon (;) 'such as in the following
example:

path c:\dos\system;c:\utils;

Wildcards
If you want to perform a task for a group of files whose names have something in
common, you do not have to use the same command repeatedly for each file name
in the group. A substitute for a name or extension is known as a wildcard. You
can use wildcards to specify groups of files.
There are two DOS wildcards:
• The asterisk (*) represents a whole word or a group of characters.
• The question mark (?) represents a single character.

22

PC DOS User's Guide

The following table shows various wildcard combinations.
Wildcard

What it represents

Examples

*.TXT

All files with a .TXT extension

JULY93.TXT, RECIPE.TXT

REPORT.*

All files named REPORT with any
extension

REPORT.TXT, REPORT.WRI

M*.*

All files beginning with the letter M,
regardless of extension

MEMO.TXT, MARCH.XLS

???*

All files having names containing three
letters or less, with any or no extension

SUN.BMP, WIN.INI, AUG

Note: When you use an asterisk in the file name or the extension, DOS ignores
the letters that come after the asterisk. For example, if you use the wildcard

*M.EXE
it is the same as if you typed

*.EXE
DOS Command Prompt
When you see this prompt (C:\», this means DOS is ready to receive a command.
The C:\> prompt is set by typing:

prompt $p$g
where $p stands for the path, and $g provides the greater than (» sign. If you
want to change ,this prompt, you can view the options available by typing help
prompt or prompt /?
The PROMPT command allows you to keep track of where you are in your tree
structure visually. For example, the prompt C:\OFFICE\LETTERS> shows you the
root, OFFICE, and LETTERS directories in the tree structure.
Add the PROMPT command to your AUTOEXEC.BAT file so that the prompt you
specify is available every time you start your computer. '

Working with Files
Certain DOS commands allow you to do tasks such as: finding, copying, renaming,
deleting, moving, comparing, modifying, creating, and viewing the contents of files
and directories.

Chapter 2. Learning Basic DOS Concepts

23

Finding Files
To find a file, use the DIR /S command. This command directs the system to list
every occurrence, in the specified directory and all subdirectories, of a specified file
name. For example, to find all occurrences of "MYFILE.DAT" on drive C, type the
following at the DOS command prompt:

dir c:\myfile.dat /s

Copying Files
You can use the COPY command to copy:
• A file from one directory or diskette to another
• A group of files by using DOS wildcards
Note: If you want to copy files from the PC DOS 7 installation diskettes, refer to
"Working with Setup Bundle Files" on page 554 first.
If your copy request involves a file that has the same name as a file or files in the
directory to which you are copying, DOS displays a message indicating that you are
about to overwrite an existing file. You are prompted to provide direction to the
system as the following example indicates:

c:\dos>copy *.dat \
Overwrite c:\scores.dat (yes/no/all)?
Your choice affects the COPY command as follows:
Yes (Y)

Overwrite the file and continue copying, or return to the DOS
command prompt if only one file is involved.

No (N)

Do not overwrite the file. Continue copying and receiving the
system prompt for overwriting if other duplicate file names are
found. Or, return to the DOS command prompt if only one file is
involved.

All (A)

Overwrite the indicated file and all subsequent files and suppress
the system prompt for overwriting while copying.

For detailed information on copying a directory tree with files, type help xcopy at
the DOS command prompt. For detailed information on duplicating a diskette, type
hel p di skcopy at the DOS command prompt. In both cases the online PC DOS 7
Command Reference is opened to the discussion about the specified command.
If you ·only want to review the abbreviated online help about a command, type the
command name followed by a /? switch (for example, di skcopy /? displays the
abbreviated online help for the DISKCOPY command).

24

PC DOS User's Guide

Copying a Single File
To copy a file to another diskette or directory, use the COpy command. To use the
COpy command, type the location and file name of the file you want to copy from
, (source file). Then type the location and file name of the file you want to copy to
(target file).
Suppose drive C is the current drive. If you want to copy the AGENDA.DOC file
from the \MEETING directory on a hard disk in drive C to the root directory on a
diskette in drive A, you would type the following command:

copy \meeting\agenda.doc a:\agenda.doc
DOS takes a copy of the AGENDA.DOC file in the \MEETING directory on drive C
and places the copy in a file having the same file name in the root directory of drive
A. If you want the source and target files to have the same file name, omit the
target file name. For example, you could use the following command to produce
the same result achieved by using the previous command:

copy \meeting\agenda.doc a:\
After you use the COpy command, DOS indicates how many files were copied:

1 file(s) copied
If DOS cannot find the file you want to copy, it displays the Fi 1e not found
message. Check to see that you typed the file name correctly and that the file is in
the directory you specified.

Using Wildcards to Specify a Group of Files to Copy
Suppose you have a number of files on a diskette in drive A that you designated as
temporary by giving them the same extension (such as .TMP). If you want to copy
these files to a diskette in drive S; you can use the asterisk wildcard:

copy a:\*.tmp b:\
Renaming a File as It Is Copied
If you want to give a new name to a file you are copying, specify the new file name
as the destination file. For example, to copy the OUTGO.XLS file from a diskette in
drive A to a diskette in drive S and rename it EXPAND.XLS, type the following at
the DOS command prompt:

copy a:\outgo.xls b:expand.xls

Chapter 2. Learning Basic DOS Concepts

25

You can copy a file to the same directory if you rename the file. If you do not
rename the file when copying it to the same directory, DOS displays the following
message:

File cannot be copied onto itself
o file(s) copied

Renaming a File
To change the name of a file without changing its location, use the REN command.
The REN command stands for rename.
For example, suppose you have two versions of a file named SALES.LST. The
version on the diskette in drive A contains last year's sales projections, whereas the
version in drive C is up-to-date. Assume drive C is the current drive. To avoid
confusion between the two files, you can use the following command to rename the
file that contains outdated prices:
For example, the following command changes a file named SALES.LST to
SALES. OLD:

ren a:\sales.lst sales.old
You can use DOS wildcards to rename a group of files. For example, if you want
all .TMP files to be renamed to .TXT files in a directory, use the following
command:

ren *.tmp *.txt

Deleting Files
You will eventually want to clean up your hard disk by removing files that are no
longer useful. You can delete a single file, a group of files, or all files in a directory
on a hard disk or diskette. When you delete files, you might not be able to recover
them. Ensure that the files you specify for deletion are the ones you want to
remove.
If you accidentally delete files you want to keep, use the UNDELETE command as
soon as possible to recover them. Refer to "Recovering Deleted Files" on page 28
for more information.

26

PC DOS User's Guide

Deleting a Single File
You delete a single file by typing the DEL command, followed by the location and
name of the file you want to delete. For example~ to delete a file named
SALES.LST from a directory on drive C, you would type the following command:
del c:sales.lst

Deleting a Group of Files
You can use DOS wildcards (an * is a wildcard) to delete a group of files. For
example, the following command deletes all files with the .TMP extension on a
diskette in drive A.
del a:\*.tmp

,

Before using the wildcard, it is a good idea to use the DIR command to view the
files in a directory. If the display scrolls off the screen too quickly, use the DIR
command with the /p switch. This switch pauses the display of information at the
end of each full screen of text and gives you a Press any key to continue .••
message that allows you to continue on to the next screen display until completed.
For example, you could type the following command to view all the files with .TMP
extension on a diskette in drive A and pause the information between screens:
dir a:\*.tmp

Ip

Deleting All Files in a Directory
To clear a directory of all files, you can use the DEL command and DOS wildcards.
For example, to delete all the files in the \OFFICE directory on drive C, type the
following:
del c:\office\*.*
If you do not specify a directory, all files in the current directory are deleted.
Whenever you specify *.* with the DEL command, the following prompt is displayed.
All files in directory will be deleted!
Are you sure (YIN)?
If you typ'e the directory without specifying any files, it is assumed you want to
delete all the files in that directory. For example, to delete all files in the \MYDOCS
directory on drive C, you could type the following command:
del c:\mydocs
If you want to delete the directory itself, use the RD (remove directory) command.
Or, you can use the DELTREE command to delete both the directory and all the
files at one time. The RD command and the DELTREE command are discussed in
more detail in "Deleting Directories" on page 36.
Chapter 2. Learning Basic DOS Concepts

27

Recovering Deleted Files
When you delete a file, DOS does not delete the data in the file. Instead, it marks
the file as deleted so DOS can reuse the area of the hard disk or diskette occupied
by the deleted file. The data remains on the hard disk or diskette until DOS records
the data of another file in the same region of the disk.
Because the data in a deleted file can remain intact for a while, it is possible to
recover a file that was accidentally deleted. As soon as you discover that the file
has been deleted, use the UNDELETE command to restore the file. If you have
created or changed other files after issuing the DELETE command, the UNDELETE
command might not be able to recover the deleted files. For more information
about undeleting files and directories, see Chapter 15, "Using Central Point
Undelete" on page 241.
The UNDELETE command works best if you set up your system to keep track of
files you delete by.using the DATAMON command in your AUTOEXEC.BAT file as
described in "Choosing a Delete Protection Method" on page 271.

Moving Files
To move files; use the MOVE command. For example, the following command
moves the file AGENDA.DOC from the current drive to a diskette in drive A.

move agenda.doc a:
If the destination you specify already has a file or files with the same name, you are
prompted to give direction to the system. You can choose the following:

YesM

28

Overwrite the file and continue moving, or return to the DOS
command prompt if only one file is involved.

. No (N)

Do not overwrite the file. Continue moving and receiving the
system prompt for overwriting if other duplicate file names are
found. Or, return to the DOS command prompt if only one file is
involved.

All (A)

Overwrite the indicated file and all subsequent files and suppress
the system prompt for overwriting while moving files.

PC DOS User's Guide

You can also move groups of files using wildcards. For example, to move all the
files on drive A with an extension of .TXT to drive C in the directory \TEXT, you
would type:

move a:*.txt c:\text
You can rename a directory when you move files. For example, to move all the
files in the \NOTES directory to a new directory with the name \LETTERS, type:

move c:\notes\*.* c:\letters
You are prompted whether you want the directory treated if it does not already
exist:

Make directory "c:\letters"?

(Y/N)

The MOVE command allows you to rename a file when you move only one file. To
move the file LETTER1.TXT from the root directory of drive C, rename it to
NEWLTR.TXT, and place it in the \LETTERS directory on drive 0, type:

move c:\letterl.txt d:\letters\newltr.txt
If the directory does not already exist, you will receive the [Unable to create
desti nati on] message. Use the MD command to create the directory, and then
retry the MOVE command.

Comparing Files
To get an approximate comparison of two files, you can look at file size and time of
creation. To get a precise comparison of two files, use the FC command. For
example, you have two text files that have the same file name; they exist on two
different diskettes. To see if they are the same and where they differ, you can use
the FC command.

To use the

Fe command to compare two files:

1. Insert one diskette in drive A and one in drive B.
2. Type the following at the DOS command prompt:

fc /a a: (jiZename).txt b:(jiZename).txt

Chapter 2. Learning Basic DOS Concepts

29

The fa switch in this example abbreviates the output for the comparison of the two
text files. DOS starts at th~ beginning of the two files and compares each byte.
When DOS finds a difference, it displays the file name, the line of text that begins a
set of differences, and the line that ends the set of differences, as in the following
example:

*****a:(filename).txt
Our expected revenues for the month of January are expected to rise
\ ...
when the results are not yet certain.
*****b:(filename).txt
Our expected revenues for January are less than projected
\ ...
when the results are not yet certain.

*****
For more information about the FC command, type hel p fc at the DOS command
prompt.

Viewing and Changing File Attributes
Every file can have the following attributes associated with it. These attributes are
used as switches with the ATTRIB command.
a

Specifies the archive attribute which is used with the RESTORE,
XCOPY, and other commands to control which files are backed up.

r

Specifies the read-only attribute which prevents a file from being
changed or deleted. When a file has this attribute, you can look at the
file but you cannot delete it or change its contents.

h

Specifies the hidden attribute which prevents DOS from displaying a file
in a directory list. The file remains in a directory, but you cannot use the
file unless you know its file name. This attribute is useful if you are
working on confidential files.

s

Specifies the system attribute which designates a file as a system file.
Files with the system attribute are not shown in directory listings.

Type he 1p attri b for more information about these attributes and how they are
used with the ATTRIB command.

Viewing File Attributes
To see a file's attributes, type the ATTRIB command followed by the file name. For
example, you would type the following to see the attributes associated with the
CONFIG.SYS file on a disk in drive A:

attrib a:\config.sys
30

PC DOS User's Guide

DOS displays up to four attributes in front of the file name. For example, if the
CONFIG.SYS file has the archive and read-only attributes, DOS displays the
following:

A R C:\CONFIG.SYS
You can see the attributes for a group of files by using wildcards with the AnRIS
command. For example, you would type the following to see the attributes of all
files in the root directory of drive C:

attrib c:\*.*
Changing a File Attribute
You can add to or take away file attributes by using the AnRIS command along
with the attribute letter. To assign an attribute, precede the attribute letter with a +.
To remove an attribute, precede the attribute letter with a -. For example, use the
following command to make the OUTGO.XLS read only:

attrib +r outgo.xls
If you decide at a 'Iater time to remove the read-only attribute from this file, you
would type:

attrib -r outgo.xls

Finding Text Within a File
If you want to search one or more files for specified text, you can use the FIND
command. For example, if your personal phone book is in the PHONE.TXT file,
you can use the following command to view all lines of the file that contain the text
"Area Code: 206":

find IIArea Code: 206

11

phone.txt

DOS searches the PHONE.TXT file and displays each line that includes the text
"Area Code: 206". You must enclose the search text in quotation marks. DOS finds
only text that exactly matches the characters you specify, including capitalization
and spacing. If the text in the file has formatting codes (for example, if the words
"Area Code" are underlined), DOS cannot find the specified text.
You can use wildcards to search all subdirectories for a set of files. Add the /s
switch to specify this type of search. The following example searches all .TXT files
and the ADDR.LST file in all subdirectories:

find IIArea Code: 206 *.txt addr.lst /s
11

Chapter 2. Learning Basic DOS Concepts

31

Understanding and Working with Directories
When you type a command at the DOS command prompt, it is carried out on the
directory you are currently using unless you specify a different directory.

Directory Tree
The organization of directories and files is called the directory tree. When you
format a hard disk, DOS creates one directory called the root directory. The root
directory is the very top-most directory. All other directories you create on the hard
disk branch out from the root directory. This is illustrated by the following:

Current Directory

Destination Directory

You can view a list of files and directories ina directory by using the DIR command
(see "Viewing Directory Contents" on page 34).

Naming Directories
Except for the root directory, which is always represented by the first backslash ( \ )
following the drive letter, each directory- has a name. A directory can also have an
extension.
The rules for directory names and extensions are the same as for naming files.
Typically, however, directory names do not use extensions. For more information,
see "File Names" on page 20.
Sometimes, you see" . " and" .. " entries in a directory (especially when you use
the DIR command to view the files and directories in a directory). These are
normal entries that are present in every directory. The single period ( . ) represents
the current directory and the double period represents the parent directory. If you
delete these entries, you can lose files.

32

PC DOS User's Guide

Working in the Current Directory
The directory you are currently working in is called the current directory for that
drive. The name of the current directory is usually shown as part of the DOS
command prompt. You might see c: \NOTES> if your current directory is \NOTES in
drive C.
For example, if drive C is the current drive and \OFFICE\NOTES is the current
directory, you can delete the REPORT1.TXT file in the C:\OFFICE\NOTES directory
by typing this command:
de 1 reportl. txt
Because drive C is the current drive and \OFFICE\NOTES is both the current
directory and where the file is located, you do not need to specify the path in the
command. DOS searches for the file in the current directory. When the file is not
located in the current directory, you can do one of the following:
• Specify where the file is located by including its path in the command.
• Change to the directory containing the file by using the CD command. The CD
command is described in "Changing Directories."
If you are working with more than one drive, each of them has a current directory.
If you do not specify a different path for the files, DOS will complete the operation in
the current drive and directory.
When you start your system, all current directories are the root directories of the
drives in your system. The current directory on a diskette drive changes to the root
directory when you change diskettes.

Changing Directories
To change to a different directory on the current drive, use the CD command. The
CD command stands for change directory.
To use the CD command, type:
cd
followed by the directory to which you want to change.

If you want to change from the current directory to a subdirectory, a directory
contained within the current directory, type the name of the subdirectory. For
example, the following command changes the current directory to.the MYDOCS
directory within the current directory:
cd mydocs

Chapter 2. Learning Basic DOS Concepts

33

If you want to change to a directory that is not a subdirectory of the current
directory, type the path for thenew directory. For example, to change from the
directory C:\MEETING\STATUS to the directory C:\ART, type the following:

cd \art
You can use double periods as a shortcut to typing the name of the parent
directory. To change to the parent of the current directory (the directory one level
closer to the root), you can also use two periods (.. ) in the command.

cd ..
Regardless of which directory is current, you can change to the root directory of the
current drive by typing:

cd \

Viewing Directory Contents .
To view the contents of a directory, use the DIR command. The DIR command
stands for directory and lists the contents of the directory you specify.
For example, if C:\ is your current directory, type the following command to view its
contents:
dir
DOS displays a listing similar to the following:

CON FIG
AUTO EXEC
DOS
MYFMT
MOVEDIR
NETWORK

SYS
BAT

525 03-30-94 6:47p
495 03-30-94 7:04p

01-14-93 9:38a
TXT
4735 02-16-93 10:43p
BAT
7046 03-08-93 8:58a

03-29-93 6:47p

Note: The file names shown here are separated from the extensions, not by a
period but by several spaces. When you refer to these files, however, you
must separate the file names from the extensions with a period.

If there is more information than can fit on one screen, use the DIR command
followed by the /p switch to view files and subdirectories one screen at a time. For
example, to view the contents of the current directory one screen at a time, type:
dir /p

34

PC DOS User's Guide

You see one screen of the directory contents. At the bottom of the screen,' you see
this prompt:

Press any key to continue . . .
If you add the path of a directory to the command, DOS displays the contents of the
specified directory rather than the current directory. Regardless of which drive and
directory are current, you would use the following command to view a list of files in
the MEETING directory on drive C:

dir c:\meeting

Viewing Groups of File Names in a Directory
Unless you specify otherwise, DOS displays all file names and directory names
contained in a directory. To view only certain file names in a directory, you can use
wildcards. For example, to see a list of all files that have a .DOC extension in the
root directory of a diskette in drive 8, type:

dir b:\*.doc

Making Directories
When you have a. group of related files (such as specialized files that you use with
one program or files from a specific project), you might want to store them in their
own directory. To create a new directory, you can use the MD command, which
stands for make directory. The new directory. cannot have the same name as any
other file or directory contained in that directory.
For example, suppose the current directory is the root (\). To create a directory
called OFFICE, you would type the following command:

md office
The MD command makes a directory within the current directory, unless you.specify
a different directory. For example, suppose the current directory is \OFFICE. While
you are within the OFFICE directory, the DOS command prompt looks like this:

C:\OFFICE>
To make a directory called NOTES, you can type:

md· notes
In this example, DOS makes a directory called NOTES in the \OFFICE directory.
To see this change, type:

cd notes

Chapter 2. Learning Basic DOS Concepts

35

at the C:\OFFICE> command,prompt. The command prompt then changes to
display:

C:\OFFICE\NOTES>
If you are not making a directory within the current directory, you must type the
entire path of the new directory or specify the path relative to the current directory.
If you include a drive letter with the MD command, you can create a directory on a
hard disk or diskette that is not current.

Deleting Directories
There are two ways to delete directories:
• You can use the DELTREE command, which allows you to remove the
directory at the same time you delete all the files and subdirectories within the
directory.
• You can use the RD command, which allows you to remove the directory or
subdirectory after you have deleted all the files within the directory.

Deleting All Files and the Directory Simultaneously
To delete a directory and all the subdirectories and files in it, you can use the
.DELTREE command. For example, to delete the \WORK directory and all the fi.les
in the directory on drive C, type the following:

del tree c:\work
You also can use the DELTREE command to delete one or more files and
directories. For example, to delete all the subdirectories and files in the \WORK
directory on drive C and to delete the \OFFICE directory and all the files within this
directory on drive A, type the following:

del tree c:\work a:\office
Use caution when you use the DELTREE command, because every file and
subdirectory within the directory you specify will be deleted. You are prompted
before the deletion of each top-level directory or file, similar to the following:

Delete directory "c:\work" and all its subdirectories? (YIN)

Deleting Only the Directory
The directory you delete cannot contain any files or other directories. If the
directory you want to delete contains files or other directories, you must delete them
first.

36

PC DOS User's Guide

To delete only the directory, use the RD command, which stands for remove
directory. For example, to delete the \MEETING\NOTES directory, type the
following command:

rd \meeting\notes
DOS removes the NOTES subdirectory from the \MEETING directory on the current
drive.
If DOS does not delete a directory after you have deleted all files and subdirectories
in it, there might be hidden or read-only. files in the directory. For information about
viewing or changing the attributes of hidden or read-only files, type hel p attri b at
the DOS command prompt.
CAUTION:
Do not use the ERASE command to delete the" . " or " .. " entries in a
directory. These are normal entries that are present in every directory. If you
erase these entries, you can lose files. (The DELETE command cannot delete
these entries.)
To delete a directory:
1. Delete all files and directories within the directory you want to delete.
For example, suppose the current directory is \ART, and \ART contains a
directory called WORK. Before you can remove the WORK directory, which
does not contain any other directories, you must delete its contents by typing:

del work\*.*
You can also type the following command with the same results:

del work
2. The following message appears:

All files in directory will be deleted!
Are you sure? (YIN)
Type Yfor Yes to delete the files. Or, type N to cancel the command.
3. Make sure the directory you are trying to del.ete is not the current directory. If it
is; change to the directory one level higher by typing the following command:

cd ..
You cannot remove a directory while it is the current directory.
4. Use the RD command to remove the directory.

Chapter 2. Learning Basic DOS Concepts

37

For example, when the WORK directory is empty, you can type the following
command to remove the directory from the \ART directory:

rd work
DOS removes a subdirectory of the current directory, unless you specify otherwise
by typing the full path of another directory. If you' include a drive letter with the RD
command, you can remove a directory from a drive that is not current.
If you delete a directory accidentally, you can use the UNDELETE command to
recover the directory and its files. For more information about undeleting a
directory, refer to "Undeleting a Directory" on page 253.

Copying Directories
To copy a directory and its subdirectories, you can use the XCOPY command. The
XCOPY command works with a single directory or a group of directories. You can
create new files in the destination directory as well as new subdirectories with this
command.
If the destination you specify already has a file or files with the same name, you are
prompted to give direction to the system. You can choose the following:

YesM

Overwrite the file and continue xcopying, or return to the DOS
command prompt if only one file is involved.

No (N)

Do not overwrite the file. Continue xcopying and receiving the
system prompt for overwriting if other duplicate file names are
found. Or, return to the DOS command prompt if only one file is
involved.

All (A)

Overwrite the indicated file and all subsequent files and suppress
the system prompt for overwriting while xcopying.

Copying All Files in a Directory
To copy a single directory (without subdirectories), use the XCOPY command
without switches. For example, the following command copies all files in the
C:\NEW\REPORTS\FINANCE directory to the \FINANCE directory on a diskette in
drive A:

xcopy c:\new\reports\finance a:\finance
If you do not make a directory before you use the XCOPY command, one will be
created for you by the XCOPY command.

38

PC DOS User's Guide

Because the XCOPY command copies all files in a directory, you do not need to
use wildcards. For example, the following XCOPY command copies all files in the
current directory from drive A to drive B:

xcopy a: b:
While DOS prepares to copy the files, it displays a Read; ng source fil e(s)
message. A message is also displayed showing the names of the files it copies
and indicating how many files were copied when the operation has completed.

Creating Directories as You Copy Files
If the destination path in an XCOPY command does not exist, DOS creates it. For
example, the following command copies all files from the root directory of a diskette
in drive A to the C:\TMP directory:

xcopy a:\ c:\tmp
If the directory does not exist, you are prompted whether the name specified is a
file or directory. To prevent DOS from prompting you, add a backslash at the end
of the directory name.
If you do not type a path, DOS copies the files to the current directory.

Copying Subdirectories
To copy files in a directory along with any subdirectories that contain files, add the

/s switch to the XCOPY command. For example, you have a diskette in drive A
that contains the following subdirectories: SCHOOL, WORK, and HOME in the
\SCHEDULE directory. The following command copies the files in the \SCHEDULE
directory of drive A, including the three subdirectories and all their files, to the
\MEMOS directory on drive C:

xcopy a:\schedule\ c:\memos /s
The backslash (\) after a: indicates that DOS should start at the root directory.
When the /s switch is added, every file in every subdirectory that contains files is
copied. DOS copies files from A:\SCHEDULE to C:\MEMOS from
A:\SCHEDULE\SCHOOL to C:\MEMOS\SCHOOL, from A:\SCHEDULE\WORK to
C:\MEMOS\WORK, and from A:\SCHEDULE\HOME to C:\MEMOS\HOME. If any of
the directories do not exist on drive C, DOS creates them. In this example, empty
subdirectories on drive A are not copied.

Chapter 2. Learning Basic DOS Concepts

39

To copy an empty directory, use the /e switch with the /s switch. For example,
suppose the diskette in drive A has an empty subdirectory called MiSe, in addition
to the three subdirectories just mentioned. You could type the following command
to copy all subdirectories, including the empty subdirectory:

xcopy a:\ c:\memos Is Ie
You can use the /s switch without the /e switch, but you cannot use the /e switch
without the /s switch.

Renaming Directories
To rename a directory, use the MOVE command. The following command renames
the \OPS\STATS directory to \OPS\FIGURES:

move \ops\stats \ops\figures
The REN command, which you use to rename files, cannot be used to rename
directories.

40

PC DOS User's Guide

Chapter 3. Using the Online Book Viewer
The PC DOS Viewer is the documentation viewer for PC DOS 7 that allows you to
read online books. PC DOS 7 comes with three books online:
Name of
Online Book
CMDREF

DOSREXX

Windows
Icon

Command
Reference

REX><

Contains ...
The online PC DOS Command Reference, which
provides information about command syntax,
PC DOS commands, device drivers, and .lNI files.

A description of the DOS REXX commands.

Information

DOSERROR

Error
Messages

An explanation of the more common error
messages for DOS and the optional tools provided
with PC DOS.

Note: You must have selected at least one optional tool for Windows in order to
have the PC DOS 7.0 Tools group and the online book icons available
when you start Windows.

Starting the PC DOS Viewer
The PC DOS Viewer can be started from:
•
•
•
•

The DOS command prompt
PC DOS Shell
IBM's OS/2
Microsoft Windows

Starting the PC DOS Viewer from the DOS Command Prompt: All online books
for PC DOS 7 have a file extension of .INF and are in the same directory as your
other PC DOS 7 files. To start the PC DOS Viewer and view any online DOS
book with an extension of .INF, at the DOS command prompt type:

view bookname
where bookname is the name of the online book-either CMDREF, DOSREXX, or
DOSERROR. For example, you would type vi ew cmdref to view the online
Command Reference. The online book also opens when you include the .lNF
extension (for example, vi ew cmdref. i nf).

© Copyright IBM Corp. 1981, 1995

41

Starting the PC DOS Viewer from PC DOS Shell: Before you can start the PC
DOS Viewer from the PC DOS Shell, first you must:
• Add the program item to the Main group.
• Give the program a title, such as "Command Reference," "Error Messages", or
"REXX Information."
• Specify the command that starts the program, such as vi ew cmdref. i nf to start
the online PC DOS 7 Command Reference.
For complete instructions for adding a program, refer to "Adding a Program Item" on
page 350.

Starting the PC DOS Viewer from OS/2: OS/2 allows you to start DOS programs
from the OS/2 desktop from either a DOS full screen or from a DOS window. The
online documentation viewer, PC DOS Viewer, is just another program that can be
started from the OS/2 desktop.

To start a DOS program from the OS/2 desktop:
1. From your OS/2 desktop, double-click on the OS/2 System icon.
2. Double-click on the Command Prompts icon.
3. Double-click on either the DOS Full Screen or the DOS Window icon.
4. To start the PC DOS Viewer, type the command used by the program
(VIEW.EXE), followed by the file name of the online book.
For example, you would type the following:

c:\DOS\view.exe cmdref.inf
if your DOS files were on drive C in the \DOS directory, to start the VIEW
command and open the CMDREF.INFfile to view the online PC DOS 7
Command Reference.
Be sure to include the letter of the drive and path containing the PC DOS
Viewer program.
5. Press ENTER.
6. Type exi t and then press ENTER to close the DOS window and return to OS/2
when you are finished.
7. Point to the title bar icon of the Command Prompts window and double-click.
8. Point to the title bar icon of the OS/2 System window and double-click.

42

PC DOS User's Guide

Starting the PC DOS Viewer from Windows: To start the PC DOS Viewer while
using Windows, use mouse button 1 and double-click on the icon for the book you
want to view. The PC DOS Viewer starts, and the online book you selected is
opened.

The icons for the PC DOS online books are located in the PC DOS Tools group.

Viewing the Initial PC DOS Viewer Screen
Whenever you type the VI EW command followed by the name of an online book,
you will see a screen similar to this:
Menu Bar

Click on to expand the Table of Contents

/

/

II

Help

Click on to close expansion

/

[., U In. the DnlIl'eL prompt and blinking cursor. To
return to your original C:\> prompt, add a PROMPT command similar to the one in
the next example (prompt $p$g).,

AUTOEXEC.BAT File Examples
The following example of a AUTOEXEC.BAT file contains the most commonly used
AUTOEXEC.BAT commands:

path=c:\;c:\dos;c:\utility;c:\batch
prompt $p$g
set temp=c:\temp
doskey
c:\smartdrv.exe
In this example:
• The PATH command directs DOS to search for program files in the current
directory and then in the following directories: the root directory of drive C,
C:\DOS, C:\UTILlTY, and C:\BATCH. A semicolon (;) separates each directory.
• The PROMPT command sets the command prompt so that it shows the current
drive and directory, followed by a greater-than sign (», ,which is the default
prompt.
'
• The SET command creates an environment variable named TEMP and sets it
equal to the directory C:\TEMP.
The name you specify must be the name of an existing directory. Many
programs, including DOS itself, use this variable when storing temporary files.
• The DOSKEY command loads the DOSKey program into memory. This
program provides keyboard shortcuts at the DOS command prompt.
DOSKEY.COM is normally installed by the PC DOS Setup program in the
directory containing your DOS files.
• The SMARTDRV command loads the SMARTDrive program into memory.

70

PC DOS User's Guide

Suppose your system has one diskette drive, one hard disk drive, a laser printer
connected to port COM1, and PC DOS Shell. You might want to put the following
commands in your AUTOEXEC.BAT file:

@echo off
path=c:\;c:\dos;c:\utility;c:\lotus;c:\norton
prompt $p$g
mode lptl=coml
set temp=c:\temp
doskey
dosshell.exe
In this example:
• The ECHO OFF command prevents the AUTOEXEC.BAT commands from
being displayed as they are carried out. The @ sign at the beginning of the
line prevents the ECHO OFF command from being displayed.
• The MODE command redirects printer output from LPT1 (its default port) to the
serial port COM1.
• The DOSSHELL command starts the PC DOS Shell program, which provides a
graphical interface that performs many of the same file-management and
disk-maintenance tasks that you perform from the command line.

Chapter 4. Configuring Your System

71

72

PC DOS User's Guide

Chapter 5. Managing Disks
Disks provide long-term information storage. The information you save on disks
remains intact until you delete it. This chapter discusses:
•
•
•
•

Types of disks and how they are used
How to format and unformat a disk
How to create a system diskette
How to label disks

Types of Disks
There are generally two classifications of disks:
• Hard disks (also referred to as fixed disks)
• Diskettes that come in two basic sizes: 5.25 and 3.5 inches
Disks store information on magnetic surfaces. In a diskette, the magnetic surface is
a thin, flexible disk inside a protective plastic cover. A hard disk has two or more
rigid disks stacked on top of each other in a sealed case. It remains .in your
computer until you upgrade to a larger hard disk or it somehow becomes damaged.
Information on disks is divided into tracks and sectors. The more tracks a disk has,
the more information it can store. The information is divided by DOS into sectors.
A sector is the basic unit of storage on a disk.
All disks need to be formatted so that they can receive and store information.
Formatting writes track and sector marks on the disk defining the areas that DOS
can use. When you format, the disk is checked for defects.
Diskettes vary in physical size and the amount of information they can hold. The
storage size of a diskette is measured in bytes for files, and kilobytes and
megabytes for disks. These terms are defined as follows:
byte

The amount of space it takes to store a character.

kilobyte

A kilobyte is approximately 1000 bytes, represented by a K in this
guide (1024 bytes for CPU memory).

megabyte

A megabyte is approximately 1000000 bytes, represented by MB in
this guide (1048576 bytes for CPU memory).

© Copyright IBM Corp. 1981, 1995

73

The most common types of diskettes that PC DOS can work with, and the capacity
for the diskettes drives include:
Diskette

Diskette-Drive Capacity

5.25-inch, double-sided/double-density

360K

5.25-inch, double-sided/high-density

1200K or 1.2MB

3.5-inch, 1MB capacity

720K

3.5-inch, 1MB/2MB capacity

1440K or 1.44MB

3.5-inch, 1MB/2MB/4MB capacity

2880K or 2.88MB

The 1MB diskettes can be used in 720K, 1.44MB, and 2.88MB diskette drives; they
must be formatted to 720K, which you do with either a 720K or a 1.44MB diskette
drive. When you use a 1.44MB diskette drive, be sure to specify a format of 720K.
The 2MB diskettes can be used in 1.44MB diskette drives or 2.88MB diskette drives
only and must be formatted to 1.44MB. You must use a 1.44MB or 2.88MB
diskette drive to format.
If you intend to transfer diskettes between computers that have diskette drives with
different capacities, use only 1MB diskettes formatted to 720K.
Note: A 1.44MB diskette drive might have "1.44" printed on the diskette eject
button. A 720K diskette drive usually has no identification mark.
Most diskettes have labels indicating their type. You can also use the DIR or
CHKDSK command to view information about the storage capacity of a formatted
diskette. Type hel p di r or hel p chkdskfor detailed information about these
commands. The online PC DOS 7 Command Reference is opened to the
command you specified.

Types of Diskette Drives
Not all types of diskettes are compatible with all types of diskette drives. In
general, the diskette must be formatted at a capacity less than or equal to the
capacity of the drive in order for the diskette and diskette drive to be compatible.
For example, if you have a high-density 5.25-inch diskette drive designed to work
with 1.2MB diskettes, you can use diskettes formatted as 360K disks. However, if
you have a 360K drive, you usually cannot use disks formatted as 1.2MB disks.

74

PC DOS User's Guide

If you are unsure whether a diskette works with a certain drive, you can try using
the diskette by inserting it into the diskette drive and using the DIR command. If
the diskette and drive are incompatible or if the diskette is unformatted, DOS
displays a General fa; lure error message.
DOS adjusts its operations to work with the type of diskette drive you are using.
When using some commands, you must add a switch if your diskette drive and
diskette do not have the same capacity.

Considerations for Formatting Disks
Before you can use a disk or diskette you must prepare it by using the FORMAT
command. The disks might or might not have been previously formatted.
When you format a disk or diskette, DOS performs a safe format by default.
Because of the safe format, you can restore the disk to the way it was before the
format by using the UNFORMAT command, provided you have not stored files on
the newly formatted disk .
. When you format a diskette or hard disk, DOS reserves a small part of the disk for
its tracking system. The tracking system consists of two parts: a file allocation
table, which tracks the location of each file on the disk, and the root directory, which
stores the name, size, creation date and time, and file attributes for the files on the
disk.
If you are using a new hard disk, you must partition it before you can format it.
While you are running the DOS Setup program, if the hard disk is un partitioned or
unformatted, you can partition and format it. For information about setting up
PC DOS on a hard disk, refer to Chapter 1, "Installing" on page 3. You can also
partition a new hard disk by using the Fixed Disk Setup Program (FDISK). For
information about FDISK and partitioning, see Chapter 6, "Partitioning Your Hard
Disk" on page 81.

CAUTION:
Because the FORMAT command destroys all information on a disk, it is a
good idea to develop the habit of using the DIR command before formatting a
disk so that you do not destroy important files. DOS displays a warning
message if you attempt to format your hard disk. If you accidentally format
your hard disk and you have not written new information to it, you might be
able to use the UNFORMAT command to recover its contents. For more
information, see "Unformatting a Disk" on page 78.

Chapter 5. Managing Disks

75

Formatting a Disk
To format a diskette or hard disk, use the FORMAT command. For example, type
the following command to format a diskette in drive A:

format a:
You must specify the drive that contains the diskette you want to format.
To format a hard disk after it has been partitioned, type:

format drive:
at the DOS command prompt. If the hard disk has already been formatted, this
message prompt is displayed:

Warning, all data on non-removable disk drive C: will be lost!
Proceed with format (YIN)?
Type y to proceed or n to cancel the command.
There are several switches that can be used with the FORMAT command. Some
.of the more common ones that you will use are:

Iq

Use this switch on a previously formatted disk to speed up formatting.

lu

Use this switch on new disks to speed upjormatting or on a disk where you
have received read and write errors during the use of the disk.
Use this switch to specify unconditional formatting. Using this switch destroys
all existing data on a disk and prevents you from using the UNFORMAT
command after formatting has taken place.

If

Use this switch to specify the size of the diskette to format. For example, if
drive A is a 1.2MB, 5.25-inch drive, and you want to format a 360K diskette in
it, you would type:
.

format a: If:360
For more information about the switches that can be used with the FORMAT
command, type hel p format to open the online PC DOS 7 Command Reference to
the detailed discussion about FORMAT.
As it formats the disk, DOS displays the percentage of the disk that has been
formatted.- After the disk is formatted, you are prompted to give the disk a volume
la~el. Type the name you want to give the disk, or press ENTER if you do not want
a label.

76

PC DOS User's Guide

DOS then displays information about how the disk has formatted:

1,213,952 bytes total disk space
1,213,952 bytes available on disk
512 bytes in each allocation unit
2,371 allocation units available on disk
Volume Serial Number is 382C-17F4
Bytes total disk space

Indicates the storage capacity of the disk.

Bytes used by system

Displayed if you have transferred the DOS system
files to the disk. This line shows how much disk
space is used by the three system files.

Bytes in bad sectors

Indicates how much of the disk is unusable
because of bad sectors. If there are no bad
sectors, this line is omitted. If a diskette has any
bad sectors, do not store important files or backup
files on it. Most hard disks have a small number of
bad sectors. In general, the portion of a hard disk
taken up by bad sectors should be a small fraction
of the total space available.

Bytes available on disk

Indicates the total disk space minus the space
taken up by the system files and any bad sectors. If
the disk does not contain system files and there are
no bad sectors, this number should be the same as
the "bytes total disk space" number.

Bytes in each allocation
unit and allocation units
available on disk

Indicates how DOS has divided the available disk
for file storage. If you multiply the two numbers on
these lines, the result is the same as the "bytes
available on disk" number.

Volume serial number

Indicates the serial number assigned to the disk.
This number does not change unless the disk is
formatted again.

Following this information, you are prompted to format another disk. Type y to
format another disk in the same drive with the same switches, or type n to return to
the DOS command prompt.

Chapter 5. Managing Disks

77

Unformatting a Disk
You can restore a disk that has been reformatted by using the UNFORMAT
command. The 9isk should be safe-formatted (that is, if you used the FORMAT
command without the /u switch). The UNFORMAT command is most effective if
used immediately after a disk has been reformatted.
If the disk was safe-formatted, UNFORMAT restores the disk to the way it was at
the time of the format. To restore a disk that has been safe-formatted, use the
UNFORMAT command. For example, to restore a hard disk (drive C), type:

unformat c:
You cannot restore a formatted disk if you use the /u switch with the FORMAT
command. The /u switch performs an unconditional format (removes the
safe-formatting). You also cannot restore a diskette if you changed its storage
capacity when you reformatted it. You need to use the UNFORMAT command
immediately after you have formatted a disk. If you have saved anything on the
disk between formatting and unformatting, you will probably lose some of the
information.
Type hel p unformat for more information about the UNFORMAT command.

Creating a System Diskette
It is recommended that you make a system diskette (sometimes called startup
diskette) to handle emergencies such as your computer system not starting. The
Setup Diskette of the PC DOS installation diskettes can be used as a startup
diskette. It has all the files you will need to restart your system. When the system
files are on a diskette, you can use the diskette to start your system from your
diskette drive.
System diskettes must contain the three DOS system files-IBMBIO.COM,
IBMDOS.COM, and COMMAND.COM. When you start your system, these three
files are copied from the system diskette to your system's random-access memory
(RAM). The IBMBIO.COM and IBMDOS.COM files are hidden files; you do not see
them in directory listings on the diskette unless you use the /a switch with the DIR
command. The COMMAND.COM file is usually in the root directory of every
system diskette.
In addition to th~se three DOS system files, you want to include the file
FDISK.COM and an editor. You must copy these files to the system diskette.

78

PC DOS User's Guide

To create a system diskette during formatting, use the FORMAT command with the
/s switch. For example, the following command formats the diskette in drive Band
makes it a system diskette:

format b: /s
You can also use the following to ensure the use of a system diskette:
• Make a formatted diskette a system diskette by using the SYS command. For
example, to copy the system files COMMAND.COM, IBMBIO.COM, and
IBMDOS.COM to a formatted diskette in drive A, type:

sys a:
• Keep the Setup Diskette from your installation diskettes handy. This diskette
also can be used as a startup diskette to start your system.
You cannot make a system diskette by using the COpy command. This command
does not copy the hidden system files. You must use the FORMAT or SYS
command. For more information about these commands, type he 1p format or help
sys at the DOS command prompt.
For information as to what files you should have if you are creating your own
system diskette or if you are creating a bootable Stacker diskette for your
compressed drives, refer to "Bootable Stacker Diskette" on page 309.
Consi~erations

for Labeling a Disk

Each disk .can have a name, called the volume label, and a number, called the
volume serial number. DOS uses the volume serial number to keep track of which
disk is in a drive. DOS assigns a serial number to a disk when you format it. The
serial number does not change unless the disk is formatted again. Only disks
formatted by DOS Version 4.0 and later have a serial number. DOS displays the
disk's volume label and serial number above the list of files in every directory.
You can change a disk's volume label by using the LABEL command. The volume
label you choose can contain no more than 11 characters, and it cannot include the
following characters: asterisk (*), question mark (?), slash (f), backslash (\), pipe ( I
), period (.), comma (,), colon (:), semicolon (;), plus sign (+), equal sign (=),
less-than sign «), greater-than sign (», caret (A), quotation mark (II), brackets ([]),
ampersand (&), parentheses ( ), or any key combinations. Volume labels can
include spaces but not tabs.
Note: You can use extended characters in a label; if you do, it is recommended
that you use code page 850. If you use code page 437, support for
extended characters is limited.

Chapter 5. Managing Disks

79

If you need more information about extended characters, this can be found in the
PC DOS 7. Keyboards and Code Pages book. This book can be optionally
purchased. See the coupon booklet included with PC DOS 7.

Assigning Labels
If you work with a large number of disks, it might be convenient to create a label for
each disk. You can view the label when you use the DIR or VOL command.
To assign a volume label, use the LABEL command. For example, to assign the
label "disk 2" to a diskette in drive A, type:

label a:disk 2
If you type a drive letter, but no label, DOS prompts you for a label. For example,
to label the diskette in drive B, type:

label b:
DOS displays the current label and serial number of the diskette in drive B and then
prompts you to type a new volume label.

Deleting Labels
To delete a volume label, use the LABEL command without a name. When DOS
prompts you to type a new volume label, press ENTER. A message appears,
asking you to confirm deletion of the volume label. Type y to delete the label.

Viewing Labels
To view a disk's volume label and serial number, use the DIR or VOL command.
When you use the DIR command, the volume label and serial number for the disk
that you specify are displayed above the list of files.
The VOL command displays the volume label and serial number of the diskette in
the drive you specify (if the disk has no serial number, only the volume label is
displayed). For example, to view the volume label and serial number of the diskette
in drive A, type:

vol a:

80

PC DOS User's Guide

Chapter 6. Partitioning Your Hard Disk
Each operating system has conventions for storing files on a hard disk. If you use
only DOS, your entire hard disk can be set up to use DOS conventions. However,
if you want to use another operating system in addition to DOS, you must partition
your hard disk into DOS sections and non-DOS sections.
If you use only DOS, you can create a single DOS partition that occupies your
entire disk. If you use only DOS and want to separate groups of directories, you
can create a second DOS partition. When you use multiple partitions, DOS still has
access to the entire hard disk. However, the files in the second partition appear to
be on a different drive.
If you are going to use your hard disk with another operating system (for example,
OS/2, which might be HPFS-formatted), you must create a partition for DOS and a
partition for the other operating system. You use an operating system by making its
partition active.
Partitioning your disk is different from formatting it. When you partition a disk, you
specify which sections of the disk DOS or another operating system can use.
When you format a disk, DOS prepares an existing partition to receive files. After
partitioning your disk, you must still format each partition before it can be used.
See "Formatting Your Hard Disk after Using FDISK" on page 94.
To create one or more DOS partitions on a hard disk, use the Fixed Disk Setup
Program (FDISK) described in "Using FDISK" on page 83.

Understanding Hard-Disk Partitions
You can create two types of DOS partitions on a hard disk:
• The primary DOS partition is the area that stores the IBMBIO.COM,
ISMDOS.COM, and COMMAND.COM hidden files necessary to run DOS. The
primary partition can contain other files as well. If you want to start DOS from a
hard disk, that disk must have a primary DOS partition that is active.
• An extended DOS partition is an area where other non-system files can be
stored on a disk. An extended partition is optional.

© Copyright IBM Corp. 1981, 1995

81

You can have up to a maximum of four partitions on a hard disk: one primary DOS
partition, one extended partition, and some non-DOS partitions, such as Boot
Manager or Novell. The extended partition can contain up to 23/ogica/ drives. A
logical drive is a section of a hard disk that serves as a separate disk drive. If you
create a primary partition that does not occupy the entire hard disk, you can create
an extended partition in the remaining space. In the extended partition, you can
create logical drives.

The Primary DOS Partition
If you start DOS from a hard disk, the disk must have a primary DOS partition that
contains the three DOS system files (IBMBIO.COM, IBMDOS.COM, and
COMMAND.COM). This partition must be the active partition. In general, the
primary DOS partition on the first hard disk is assigned the drive letter C.
You can reserve a portion of the disk space for the primary DOS partition. The rest
of the disk space can be used for other partitions.

The Extended DOS Partition
When you create an extended DOS partition, you divide it into one or more logical
drives. There are 26 letters available for logical drives (A through Z). Drives A and
Bare reserved for diskette drives. Drive C is reserved for the first primary DOS
partition. Thus, there is a maximum of 23 logical drives that you can create in an
extended DOS partition.
You can use logical drives to group your directories and files. Logical drives do not
create more disk space, however.
For information about creating an extended DOS partition, see "Creating an
Extended DOS Partition" on page 88.

Non-DOS Partitions
Non-DOS partitions are partitions for other operating systems (such as OS/2
HPFS). You cannot use the DOS version of the Fixed Disk Setup Program to
create a non-DOS partition. For information about creating non-DOS partitions, see,
the documentation provided for your non-DOS operating system.

82

PC DOS User's Guide

The Active Partition
To start your operating system from a hard disk, you must make the primary
partition (in which the operating system is stored) the active partition. For example,
to use DOS, make your primary DOS partition active. You can use a partition that
is not designated as active, but you cannot start an operating system from that
partition. The only way you can start an operating system from a partition not
designated as active is if you run a multi-boot manager program, such as IBM OS/2
Boot Manager, which must be active.
A hard disk can have only one active partition at a time.
When you have only a primary DOS partition, it is the active partition. For more
information about the active partition, see "Setting the Active Partition" on page 91.

Using FDISK
The FDISK program displays information about partitions, creates partitions and
logical drives, sets the active partition, and deletes partitions and logical drives.
If your computer has never had an operating system installed on it, you can choose
to have your disk partitioned during installation. Or, you can run FDISK at any time
to partition a disk.

CAUTION:
FDISK destroys all existing files in partitions you modify. If you are using
FDISK to change the partitions on a disk with files on it, be 'sure to back up
the files you want to keep before you begin. If you want to create smaller
partitions on a hard disk that has only a large DOS partition, you must first
back up all files you want to save.

Running FDISK during DOS Installation
If DOS is the first operating system to be set up on your computer, you can choose
to partition your disk when you run the Setup program. By default, the Setup
program creates one primary DOS partition that occupies the entire disk. If you
want to create more than one partition, select A11 ocate some free hard di sk
space for PC DOS during Setup. To partition the disk, follow the steps described in
the subsequent sections of this chapter. When you finish creating partitions, DOS
continues the Setup program. For more information about setting up DOS, refer to
Chapter 1, "Installing" on page 3.

Chapter 6. Partitioning Your Hard Disk

83

Running FDISK after DOS Has Been Installed
If you want to repartition your disk (at any other time than during PC DOS
installation), type the following at the DOS command prompt:

fdisk
When the Fixed Disk Setup Program starts, the main FDISK options menu appears,
as follows:

PC DOS Version 7.0
Fixed Disk Setup Program
Copyright (c) IBM Corporation 1983 - 1995 '
FDISK Options
Current fixed disk drive: 1
Choose one of the following:
1. Create DOS partition or Logical DOS Drive

2.
3.
4.
5.

Set active partition
Delete partition or Logical DOS Drive
Display partition information
Change current fixed d~sk drive

Enter choice: [1]
Press Esc to exit FDISK
CAUTION:

If you useFDISK to delete existing partitions on a hard disk, you lose the
information contained in those partitions. Be sure you have copies of all files
!
in a partition before using FDISK to delete the partition.
To choose a menu option, type the option number and then press ENTER. To
return to a previous menu, press ESC. To quit FDISK, return to the options menu,
and then press ESC.
Each menu displays a Current fi xed di sk dri ve message, followed by a number.
If you have only one hard (fixed) disk drive, the number is always 1. If you have
more than one hard disk drive, the number shows which drive FDISK is currently
working with. The first hard disk drive in your system is 1, the second is 2, and so
on. Changing the current drive when you are using FDISK does not change the
current drive when you return to the DOS command prompt. The current drive
refers only to physical disk drives, not logical drives, when you are using FDISK.

84

PC DOS User's Guide

Viewing Partition Data
You can view information about the status, type, and size of the partitions on a hard
disk by selecting Display partition information (option 4) from the FDISK options
menu.
The Display Partition Information screen looks similar to this:

Display Partition Information
Current fixed disk drive: 1
Partition Status Type
C:l
A
PRI DOS
2
EXT DOS
Total disk space is

Volume Label
PCDOS_7

Mbytes System
21
FAT16
21

42 Mbytes (1 Mbyte

=

Usage
50%
50%

1048576 bytes)

The Extended DOS partition contains Logical DOS Drives.
Do you want to display logical drive information (yiN) ...... ? [YJ
Press Esc to return to FDISK options
The information displayed varies, depending on the number, size, and type of
partitions on your hard disk.
Column

Description

Partition

Shows the drive letter associated with each partition and the disk
number of each partition.

Status

Displays the letter A next to the active partition.

Type

Shows whether a partition is a primary DOS partition (PRI DOS), an
extended DOS partition (EXT DOS), or a non-DOS partition (Non-DOS).

Volume Label

Shows the volume label of the primary partition, if one exists.

Mbytes

Shows the size of each partition, in megabytes.

System

Shows the type of file system being used on the partition.

Usage

Shows the percentage of the current disk that each partition occupies.

If there is an extended DOS partition that contains logical drives, a prompt appears,
asking whether you want to see information about that partition's logical drives.
Type Y if you wantto view this information.

Chapter 6. Partitioning Your Hard Disk

85

The screen displaying information about logical drives resembles this:

Display Logical DOS Drive Information
Drv Volume Label
D: BACKUPA
E: BACKUPB

Mbytes System Usage
18
FAT16
90%
2
FAT12
10%

Total Extended DOS Partition size is 29 Mbytes (1 Mbyte

1048576 bytes)

Press Esc to continue
The information varies, depending on the number and size of the logical drives.
Column

Description

Drv

Displays the drive letter of each logical drive.

Volume Label

Shows the label assigned to each drive.

Mbytes

Shows the size of each logical drive, in megabytes.

System

Shows the type of file system being used on that partition.

Usage

Shows the percentage of available space in the extended DOS partition
that each logical drive occupies.

Creating a Primary DOS Partition
The hard disk you use to start DOS must have a primary DOS partition. You can
create a primary DOS partition that occupies the entire hard disk or only part of it.
If you want to create an extende9 DOS partition yvith logical drives or if you want to
have space for a non-DOS partition, you must create a primary DOS partition that
does not occupy your entire disk.
You cannot change the size of an existing primary DOS partition. If you want a
primary DOS partition of a different size, you must delete the existing partition and
create a new one. When you delete the existing partition, you lose any information
stored there, so back up files you want to save. For information about deleting a
partition, see "Deleting a Partition or Logical Drive" on page 92.
If your hard disk does not already have a partition, you can use the following
procedure to create a primary DOS partition that occupies the entire disk.

86

PC DOS User's Guide

To create a primary DOS partition that occupies the entire hard disk:
1. From the FDISKoptionsmenu, select Create DOS partition or Logical DOS
Dri ve (option 1) and press ENTER.
Another menu is displayed.
2. Select Create Primary DOS Partition (option 1) and press ENTER.
Another prompt appears, displaying this message:

Do you wish to use the maximum size for a Primary DOS
Partition and make the partition active (yiN) ......... ? [YJ
3. Type Y
If you type N, FDISK prompts you to create a smaller primary partition. See the
next procedure for more information.
FDISK creates a primary partition that takes up all the available space on the
hard disk. If you have only one hard disk, DOS displays the following
message:

System will now restart
Insert DOS system diskette into drive A:
Press any key when ready
4. Insert the Setup Diskette from your PC DOS installation diskettes into drive A,
and then press any key.
After partitioning the hard disk, you need to format it by using the FORMAT
command with the./s switch. For more information, see "Formatting Your Hard Disk
after Using FDISK" on page 94.
To create a primary DOS partition that occupies part of the hard disk:
1. From the FDISK options menu, select Create DOS part it i on or Logi ca 1 DOS
Dri ve (option 1) and press ENTER.
Another menu is displayed.
2. Select Create Primary DOS Partition (option 1) qnd press ENTER.
Another prompt appears, displaying this message:

Do you wish to use the maximum available size for a Primary DOS
Partition and make the partition active (yiN) ......... ? [YJ

Chapter 6. Partitioning Your Hard Disk

87

3. Type N and another menu is displayed.
4. If you want the default size (100 percent), press ENTER.
The following

m~ssage

is displayed:

Primary DOS Partition created, drive letters changed or added.
Otherwise, type the number of megabytes or the percentage of the disk to use.
If you type a percentage, follow the number with a percent (%) sign.
Note: When you create a primary DOS partition that does not occupy your
entire hard disk, you must make the partition active before you can use
the hard disk with DOS. For more information about making a partition
active, see "Setting the Active Partition" on page 91.

5. To return to the FDISK options menu, press ESC.
When you quit FDISK, you need to format the new partition on your hard disk by
using the FORMAT command with the /s switch. For more information, see
"Formatting Your Hard Disk after Using FDISK" on page 94.

Creating an Extended DOS Partition
If you want to divide your hard disk into more than one DOS partition, you can
create an extended DOS partition in addition to the primary DOS partition,. Within
the extended DOS partition, you typically can assign up to 23 logical drives. Logical
drives are areas of your hard disk that DOS treats as separate disk drives. You
must assign at least one logical drive to an extended DOS partition.
• If you have one hard disk:

Before you can create an extended DOS partition, there must already be a
primary DOS partition that uses only part of the disk.
• If you have more than one hard disk:

Only the disk you use to start your system must have a primary DOS partition.
Your other hard disk can contain only extended DOS partitions.
• If you have more than one hard disk but are using only one partition per disk:

Set the one single partition as the primary partition.

88

PC DOS User's Guide

To create an extend(;!d DOS partition:

1. From the FDISK options menu, select Create DOS part it i on or Logi ca 1 DOS
Drive (option 1).
The Create DOS Partition or Logical DOS Drive menu appears.
2. From this menu, select Create Extended DOS Partition (option 2) and press
ENTER.

A menu is displayed showing the total number of megabytes available for an
extended partition. The default for the partition size is the maximum available
space on the hard disk drive, minus the size of the primary partition. If there is
no space available, you must delete and re-create the primary DOS partition so
it is smaller or reduce the size of any non-DOS partitions that exist.
3. If you want the default size, press ENTER. Otherwise, type the number of
megabytes or the percentage of the unused disk space to be used for the
extended DOS partition. If you type a percentage, follow the number with a
percent (%) sign.
The Create Logical Drive(s) screen in the Extended DOS Partition menu is
displayed.
When you create an extended DOS partition, you can set up one or more logical
drives. See the following section for more information.
Note: If FDISK finds defective tracks at the beginning of an extended DOS
partition, it adjusts the partition boundaries to avoid those tracks.

Creating Logical Drives in an Extended DOS Partition
To store information in an extended DOS partition, you must create one or more
logical drives. Each logical drive is assigned a drive letter. You can store to and
retrieve information from a logical drive as though it were a physical disk drive. For
example, you can use logical drive 0 to store files for a particular program, and you
can work with those files by specifying drive D.

Chapter 6. Partitioning Your Hard Disk

89

To

create or modify a logical drive:

1. Create an. extended DOS partition.
See page 89 for information about how to create an extended DOS partition.
2. Using the Create Logical DOS Drive(s) menu, type the number of megabytes or
the percentage of the partition space you want to use for the first logical drive.
If you type a percentage, follow the number with a percent (%) sign. If you
want one logical drive to occupy the whole extended DOS partition, press
ENTER.

3. Continue specifying the sizes of partitions until you have used up the entire
partition or until you have created all the logical drives you want.

If the entire partition is assigned to logical drives, the FDISK options menu
reappears. To quit the menu before all the space has been allocated, press
ESC.

After you create a logical drive, you must format it. For more information about
formatting a logical drive, see "Formatting Your Hard Disk after Using FDISK" on
page 94.

How Drive Letters Are Assigned
The primary DOS partition on your startup hard disk is drive C. The drive letters of
additional hard disks and logical drives depend on the number of disks you are
using and how they are partitioned.
If you have only one hard disk, logical drives you create in the extended DOS
partition are given letters beginning with D. For example, if you create five logical
drives in the extended DOS partition, they are named 0, E, F, G, and H.
If your system has more than one hard disk and you have only one primary DOS
partition, all logical drives you create in the extende"d DOS partitions are assigned
drive letters consecutively.
Suppose your system has two hard disks. "The first has a primary DOS partition
and an extended DOS partition with two logical drives, and the second hard disk
has an extended partition with two logical drives. The primary DOS partition on the
first disk is drive C; the two logical drives on the disk are drives 0 and E. The-two
logical drives on the second disk are drives F and G.
You might have primary DOS partitions on more than one hard disk. If so, DOS
assigns drive letters consecutively to all the primary DOS partitions first and then
assigns drive letters consecutively to the logical drives in the extended DOS
partitions.

90

PC DOS User's Guide

Substituting Drive Letters
Some programs accept only drive letters A and B. In these cases, you can use the
SUBST (substitute) command, which temporarily substitutes a drive letter with
another drive letter and path. While a substitution is in effect, DOS regards any
reference to drive A or B as a reference to a directory on your hard disk.
For example, suppose you are using a communications program that accepts only
files from drive A. To substitute the drive letter A for the \COMM directory on
drive C, you would type the following command before starting the program:

subst a: c:\comm
Then, when the program requests files from drive A; DOS looks in C:\COMM
instead.
The drive letter you specify in the SUBST command must not be greater (in
alphabetic order) than the last drive being used on your computer or the letter
specified in the LASTDRIVE command in your CONFIG.SYS file.
Type help 1astdri ve for more information about the LASTDRIVE command. The
online PC DOS 7 Command Reference is opened to the LASTDRIVE command.
When you finish using the program, remove the association between the drive and
the directory by using the /d switch:

subst a: /d
The following commands ignore any substitutions you make when using the SUBST
command: FORMAT, CHKDSK, DISKCOMP, DISKCOPY, FDISK, LABEL,
RESTORE, and SYS.

Setting the Active Partition
The active partition contains the operating system that is loaded when you start or
reset your system. Unless you create a primary DOS partition that occupies your
entire hard disk, you must set the active partition by using FDISK. If you are using
a non-DOS partition, you must reset the active partition when you want to switch
between DOS and the non-DOS operating system. Only one partition can be active
at a time.

Chapter 6. Partitioning Your Hard Disk

91

To set the active partition:

1. From the FDISK options menu, select Set Active Partition (option 2).
A menu is displayed that indicates the status of each partition. The active
partition is designated by the letter A in the Status column.
2. Type the number of the partition you want to make active. The default setting
is the current active partition number.
3. To return to the FDISK options menu, press ESC.
You can make only primary partitions active. If you try to make an extended DOS
partition active, FDISK displays a message similar to the following:
Partition selected (3) is not startable, active partition not changed.

,Deleting a Partition or Logical Drive
You might need to change the size of your partitions. You cannot reduce or
enlarge an existing partition. If you want to change a partition's size, you must
delete the partition and re-create it.
When you delete a partition, all information in the partition is deleted and cannot be
recovered. Therefore, be sure you have backup copies of the information you want
to save. When you delete a partition, you do not lose information stored in other
partitions on your disk. For example, if you delete the extended DOS partition but
not the primary DOS partition, files in the primary DOS partition are not deleted.
If you want to delete the primary DOS partition on a disk, first delete each logical
drive in the extended partition, and then delete the extended partition itself.
You can delete one or more logical drives in the extended DOS partition of a hard
disk. All information on a logical drive is lost when you delete it. Deleting one
logical drive does not affect the information on other logical drives.
i

If there are logical drives that have drive letters greater (in alphabetic order) than
the drive you delete, these letters will change. Suppose, for example, that you'
have logical drives 0, E, and F on a disk. If you delete drive 0, drive E becomes
drive 0, and d~ive F becomes drive E.
Note: To continue using DOS after you delete the primary DOS partition, you must
restart your system, using the Setup Diskette from your PC DOS installation
diskettes into drive A.

92

PC DOS User's Guide

To delete a partition or logical DOS drive:

1. From the FDISKoptions menu, select Delete partition or Logical DOS Drive
(option 3).
Another menu is displayed.
2. Type the number of the option you want.
FDISK displays the status of the partition or logical drives, along with a
message warning that the data in the partition or logical drive will be lost.
3. Type the number that corresponds with the drive letter and then type the
volume label of the logical drive you want to delete.
FDISK displays a message confirming the information you typed.
4. Type Y to delete the partition or drive.
If you deleted your primary DOS partition, you need to create a new one before you
can use DOS from your hard disk.
To create a new primary DOS partition before you quit the Fixed Disk Setup
Program:

1. From the FDISK options menu, select Create DOS part; t; on or Log; ca 1 DOS
Drive (option 1).
Another menu appears.
2. Follow the instructions in the preceding sections to create a DOS partition that
occupies either your entire hard disk or only part of it.
When FDISK is finished, a prompt appears.
3. Insert the Setup Diskette from your PC DOS installation diskettes into drive A
and press any key to restart your system.
4. Format the new partition by using the FORMAT command with the /s switch.
5. Remove the Setup Diskette from drive A and restart your system.
At this point, your hard disk contains the DOS files IBMBIO.COM, IBMDOS.COM,
and COMMAND.COM.

Chapter 6. Partitioning Your Hard Disk

93

Working with More Than One Hard Disk
If your system has more than one hard disk drive, you. can use FDISK to create and
modify partitions on any drive. The first physical disk must have a primary DOS
partition. Your other disks can have primary DOS partitions or extended DOS
partitions, or both. On most computers with multiple hard disks, only drive C can
be used to start the operating system.
When you start FDISK, you work with the first hard disk on your system. To work
with a different disk drive, you must select Change current fixed disk drive
(option 5) from the FDISK options menu and specify the number of the drive you
want to work with. If you have only one hard disk drive, the Change Current Fi xed
Di sk Dri ve option is not displayed on the FDISK options menu.

Formatting Your Hard Disk after Using FDISK
When you quit FDISK after you change the size of any of the DOS partitions on
your hard disk, this message is displayed:

System will now restart
If you changed the size of your primary DOS partition, FDISK prompts you to insert
the DOS system diskette (the Setup Diskette from your PC DOS installation
diskettes) into drive A and press any key. You then return to the DOS command
prompt.
After using FDISK, you must use the FORMAT command to prepare any partition
that you create or change. If you do not format the disk, DOS gives you the
following error message when you try to use the hard disk:

Invalid media type
If you are formatting the primary DOS partition of the hard disk from which you will
start your system, be sure to transfer the DOS system files from a diskette by using
the FORMAT command with the /s switch or by using the SYS command after you
format.
When you format your hard disk, you must format each new partition separately.
For example, if you made your primary DOS partition (drive C) smaller and created
two logical drives in an extended DOS partition (drives 0 and E), you must use the
FORMAT command three times:

format c: /s
format d:
format e:

94

PC DOS User's Guide

The first command formats the primary partition and transfers the DOS system files
from the startup disk to that partition. The second and third commands format the
logical drives.
CAUTION:
If you made changes to some but not all of the partitions or logical drives on
your system, be careful when you format the partitions or drives you
changed. Because FDISK can assign different letters to drives after you
change partitions or logical drives, you might inadvertently format a drive that
has information stored on it.

Before you format a drive, you can use the CHKDSK command to check the
contents of the drive. If you see the message Probable non-DOS disk or Inval id
med i a type before the disk information is displayed, the drive is not formatted. If
the disk information is displayed without this message, the drive is formatted.
You might want to give a descriptive label to each logical drive you create so that
you know what information is on it when you make changes to your system. You
can do this by using the Iv switch when you use the FORMAT command.
For more information, see "Considerations for Formatting Disks" on page 75.

Chapter 6. Partitioning Your Hard Disk

95

96

PC DOS User's Guide

Chapter 7. Working with Batch Programs
As you work with DOS, you might find yourself repeatedly typing identical
sequences of commands. For example, you might often type the same three
commands to change the current drive, change the current directory, and then start
a program. By using DOS, you can store commands in a batch program or batch
file. Instead of typing commands individually, you need only type the name of the
batch program. DOS carries out this "batch" of commands as if you had typed the
commands individually from the keyboard.
A batch program is an unformatted text file that contains one or more DOS
commands. For example, a batch program might contain the commands you use to
change your directory and start a text editor, such as the E Editor.
Suppo'se you are copying files to a diskette by using the following commands:

cd\work\docfiles
copy *.txt a:
cd\reports\xfiles
copy *.txt a:
To put these four commands into a batch program, store them in an unformatted
text file and assign the file a .BAT extension. Each time you want to copy these
files, type the name of the batch program at the DOS command prompt.
Using batch programs gives you the following advantages:
• Batch programs speed up your work .. When you run a batch program, you only
have to remember one command, instead of several. You do not have to
retype multiple commands or look up commands you cannot remember.
• Batch programs customize DOS. Using batch programs, you can create
personalized commands that perform the exact task you need. You can also
design your own prompts and messages.

© Copyright IBM Corp. 1981, 1995

97

Understanding Batch Program Commands
Any DOS command you use at the DOS command prompt or run from the PC DOS
Shell can also be put in a batch program. In addition, there are DOS commands
that are specially designed for batch programs. The commands and their functions
are as follows:
Command

Action

CALL

Runs a second batch program and then returns to the first one.

CHOICE

Prompts you to choose from a set of choices, waits until you choose by
pressing a key, and beeps if you select a key that is not among the
available choices.

ECHO

Displays messages on your screen or turns the ECHO feature on or off.

FOR

Carries out a command for a group of files or directories.

GOTO

Switches to commands in another part of your batch program and
continues processing the commands from that point.

IF

Carries out a command, based on the result of a condition.

PAUSE

Temporarily stops your batch program from running; your program starts
running again when you press any key.

REM

Annotates your batch program so that you can remember what each
'
part of the program does.

SHIFT

Changes the position of replaceable parameters.

@

Is placed in front of a command in your batch program and prevents the
single command from being displayed.

The CALL, ECHO, GOTO, IF, PAUSE, and REM commands are explained further
in this chapter.
For information about the remaining commands (FOR, CHOICE, and SHIFT), refer
to the online PC DOS 7 Command Reference, or type the command name
followed by /? for the abbreviated online help.

98

PC DOS User's Guide

Creating a Batch Program
You can create a batch program by using the E Editor or the COPY command.
When you use a text editor other than the E Editor to create a batch program, save
your files as unformatted (ASCII) text. Most text editors have an option for saving
files this way. For information about the E Editor, see Chapter 10, "Working with
the Text Editor" on page 131.
When you are creating a small batch program, it might be more convenient to use
the COPY command, which is described on page 102.

Naming a Batch Program
A batch program must have a .BAT file-name extension. It is generally not a good
idea to give a batch program the same name as an existing DOS command.
Suppose, for example, that you create a batch program for a customized formatting
command and name it FORMAT.BAT. The program does not run if DOS finds the
FORMAT.COM file before it finds FORMAT. BAT, because DOS gives precedence
to files with .COM and .EXE extensions.
You can avoid this problem by using a name that is not already assigned to a DOS
command. For example, you might name the program MYFMT.BAT.

Running a Batch Program
To run a batch program, you type its name without the extension. For example, if
you had a file named FILES.BAT in your current directory, type the following
command to run the batch program:

fil es
When the batch program has parameters, add a space after the file name. For
example, when the FILES.BAT program requires a file specification as a parameter,
type a command like this:

files c:\reports\data
By default, DOS displays each command in a batch program as the command is
carried out. After the batch program runs, DOS might display twb DOS command
prompts because it treats the end-of-file character in a batch program as a new
line.

Chapter 7. Working with Batch Programs

99

Stopping a Batch Program
When you want to stop a batch program before all of its commands have run, press
CTRL+C or CTRL+BREAK (more than once, if necessary). You get a message
asking to confirm that you want to stop the batch program.
Type y to stop the program or n to continue with the next command. You can
temporarily stop a batch program by pressing CTRL+S or the PAUSE key. This
"freezes" the screen until you press another key.
When your batch program is on a diskette and you remove the diskette while theprogram is running, DOS displays the following message:

Not ready reading drive A
Abort, Retry, Fail?
Re-insert the diskette, and type the letter r to continue running the batch program.

Making a Small Batch Program
You can use the E Editor provided with DOS to create a batch program. When
there are more than a few lines in your batch program, it is a good idea to use a
text editor to create the file.
Suppose, for example, you want to create a batch program that formats a 360K
diskette in your high-density diskette drive. To create the program and name it
MYFMT.BAT, use the following E command:

e c: \myfmt. ba t
At this point, the file is empty and the cursqr is placed where you can add the
FORMAT command to the file. Type the following:

format a: If:360
Now you are ready to close the file and return to the DOS command prompt. You
do so by pressing F4.
After you have created the batch program, you need only type the name of the
batch program to format a 360K diskette in your high-density diskette drive, as
follows:

myfmt
DOS displays the FORMAT command on the screen, and then prompts you to
insert a diskette into drive A. Make sure the directory that contains this batch·
program is either current or in the directory search path.

100

PC DOS User's Guide

Testing a Batch Program
It is generally best to a create a large batch program in stages. This ensures that
one part of the batch program works before you create another part.
When you run a batch program that contains a command that is not valid, DOS
cancels that command and proceeds to the next. If the batch program is set up to
display commands as they are carried out, you will see an error message when a
command is not valid. If commands are not displayed, the batch program will
contain an ECHO OFF command. Remove any ECHO OFF commands if you want
commands to be displayed along with the error messages.

Displaying Messages with a Batch Program
You can include messages in a batch program to prompt you for additional
information or to remind you of a particular task that the batch program does.
When you want DOS to display a message on your screen, use the ECHO
command. For example, to display the message Put a di skette into dri ve A,
you would use the following command:

echo Put a diskette into drive A
Tip: On networks; your message is displayed quicker when you put it in a .TXT file
and then use the TYPE command in your batch program to display the message.
DOS displays this message on the screen. When you want the ~essage shifted to
the right a certain number of spaces, you must include the spaces as part of the
message. For example, to center the message on your screen, add the necessary
spaces in the command, as follows:

echo

Put a diskette into drive A

When you want to skip a line, type ECHO followed by a period:

echo.
When ECHO is on, DOS displays batch commands at the command prompt as it
carries them out. Therefore, the message in the preceding example (Put a
di skette into dri ve A) is displayed twice: first at the command prompt as part of
the batch command and then as a prompt to carry out the command itself. To.
suppress commands that appear at the command prompt and display a message
only once, use the following command:

echo off
Make this command the first line of your program.
Chapter 7. Working with Batch Programs

101

To prevent a single command in your batch program from being displayed, put an
at sign (@) in front of it. For example, to prevent the display of the ECHO OFF
command, type:

@echo off
When you want commands to be displayed, use this command at the beginning of
the program:

echo on

Using the PAUSE Command
To momentarily stop a batch program at a predetermined command or print task,
use the PAUSE command in the batch program, as follows:

pause
When DOS finds a PAUSE command in a batch program, it displays the following
message:

Press any key to continue ...
DOS stops running the program until you press any key (except the PAUSE key).
For example, adding a PAUSE command to the following COPYIT.BAT program
stops the program from running while you put a diskette into drive A.

echo off
echo Put a diskette into drive A then
pause
copy c:\work\may\*.txt a:
copy c:\reports\may\*.doc a:
cls
echo Here are the files you copied:
echo.
dir a: /p
When this batch program pauses, DOS displays the following:

Put a diskette into drive A then
Press any key to continue ...

102

PC DOS User's Guide

Including Remarks in a Batch Program
When your batch program is longer than a few lines, it is helpful to include remarks.
You can use remarks to comment on the commands in a batch program and to
make the program easier to read by separating it into sections.
You add a remark by typing rem followed by a space and the comment you want to
include, as in this example:

rem'This part of the batch program copies files to a diskette.
Note: Ensure that the ECHO command is turned off before using the REM
command.
After you type rem and a space, DOS ignores any other text on the line. Therefore,
you can type any character you want on the remark line or leave it blank with the
exception of the following character symbols that have special meanings for
COMMAND.COM:
• less-than «)
• greater-than (»
• pipe ( I )
For example, the following remarks divide and explain sections of COPYIT.BAT:

rem *****Copy of the MAY subdirectories*****
rem
echo off
echo Put a diskette into drive A then
pause
copy c:\work\may\*.txt a:
copy c:\reports\may\*.doc a:
rem
rem Clear the screen and display the files that were copied
rem
cls
echo Here are the files you copied:
echo.
dir a: /p
Remarks do not affect the way a batch program runs; they simply annotate the
'
commands for anyone who reads the file.

Chapter 7. Working with Batch Programs

103

Running One Batch Program from Another
You can run a batch program from another batch program by including just the
name of the program you want to start or by including the CALL command with the
name of the program. If you type only the name, the original batch program quits
running, and the new batch program runs.
For example, the following batch program runs four commands and then starts a
batch program named NEXTONE:

a:
cd\tmp
copy c:\*.sys a:
cd\perm
nextone
When NEXTONE finishes running, DOS displays the command prompt.
If you want to return to the original batch program after running the other batch
program, use a CALL command with the name of the program you want to start.
When the second batch program finishes running, DOS returns to the original batch
program and carries out the next command.
For example, the following batch program carries out two commands, starts
NEXTONE, and then carries out ,two more commands when NEXTONE finishes
running:

a:
cd\tmp
call nextone
copy c:\*.sys a:
cd\perm

104

PC DOS User's Guide

Using Replaceable Parameters
DOS includes symbols called replaceable parameters, numbered %0 through %9.
You can include replaceable parameters in a batch program. When you run the
batch program, DOS replaces the symbol with the parameter you include when you
type the batch command.
The %0 replaceable parameter substitutes for the name of the batch command as it
is typed at the DOS command prompt.
Replaceable parameters %1 through %9 substitute for command-line parameters
typed after the batch-command name. The first parameter on the command line is
%1, the second is %2, and so on. If you want to specify more than nine
parameters, use the SHIFT command.
Type hel p shi ft for information about the SHIFT command.
Suppose you created a batch program (COPYIT.BAT) that moved data from one
subdirectory to another. After the creation of the batch program, you could use the
replaceable parameter feature to accomplish this task. The following example
illustrates this:
copyit %1 %2
This batch program in COPYIT.BAT is set up to move all information from the first
parameter %1 to the second parameter %2. If you wanted to move all information
from subdirectory c: \apr; 1\ *. * to drive A using the replaceable parameters,type
the following at the DOS command prompt:
copyit c:\april\*.* a:
DOS replaces %1 with c: \april \ *. * and %2 with a:
Note: If you use the percent ,sign (%) as part of a file name or string within a batch
program, you must type it twice. The first occurrence indicates that the
second % is part of a name, rather than a replaceable parameter.

In addition to replaceable parameters, you can use environment variables in a batch
program. Type help set for information about environment variables and an
example of how to use one in a batch program.

Chapter 7. Working with Batch Programs

105

Controlling Program Flow
To increase the flexibility of a .batch program, you can use the IF command to carry
out different commands under different conditions and use the GOTO command to
switch to different parts of the program. By using replaceable parameters with IF
and GOTO commands in a batch program, you can perform complex tasks.

Using the IF Command
You can use the IF command to specify a condition that must be true for a
command to be carried out. For example, suppose you want to create a batch
program named RUNIT.BAT that starts your chess program, CMATE, when you
type the following command:

runit A
To perform this task, include the following IF command in RUNIT.BAT: '

if l%tn==IA" cmate
The double equal sign (==) means the parameter must equal the value. When DOS
carries out this command, it checks to see whether or not %1 is an A. If %1 is an
A, DOS carries out the command that follows (in this case, it starts the CMATE
program). When you quit CMATE, DOS carries out the command on the next line
of RUNIT.BAT.
If % 1 is not an A, DOS skips the command that runs CMATE and moves to the
next line of the batch program. Both the parameter and the letter with which it is
compared should be enclosed in quotation marks to avoid syntax errors when no
parameter is present.

USing the GOTO Command
The GOTO command directs your program to switch to another part of the program
and continue processing the commands at that point. The line that the program is
to switch to is marked with a label preceded by a colon (:). The same label
appears in the GOTO command, as in the following example:

goto ski, pdown
echo both of these echo commands
echo will be skipped
:skipdown
cls

106

PC DOS User's Guide

Using the IF and GOTO Commands Together
If you use the GOTO command with an IF command, you can run different sections
of a batch program under different conditions. For example, when you are at the
command line about to run the batch file, the following command directs DOS to
switch to the line labeled chess if you type an uppercase A:
if lJ%l lJ == IJ AIJ goto chess
Using a series of IF commands, you can create a batch program that can run
several programs. For example, the following batch program changes to the
C:\GAMES\CHESS directory and runs the CMATE program if you type an
uppercase A; it also changes to the C:\GAMES\CHECK directory and runs the
CHECKERS program if you type anything but an uppercase A.

if 1J%1"==IJAIJ goto chess
rem
rem****************************************************
rem If the user doesn't type A, run Checkers.
rem
cd\games\check
checkers
rem Checkers game has finished running to the end of this batch file
rem Skip over Chess by jumping to the line labeled :end.
goto end
rem
rem
rem *******************************************************
rem If DOS jumps to this label, the user wants Chess.
rem
:chess
cd\games\chess
cmate
rem The following line marks the end of the batch program.
:end

Chapter 7. Working with Batch Programs

107

108

PC DOS User's Guide

Chapter 8. Redirecting Input and Output
Redirection characters let you perform many useful tasks. A redirection character
changes the place that a command gets information from or sends information to.
Redirection characters are useful when you want DOS to save information in a file
rather than display it on your screen. You can also use a filter command to redirect
information that a command typically would send to the screen. Filter commands
help you sort, view, and select parts of the output of a command.

Redirecting Command Input and Output
Unless you specify otherwise, DOS receives input from your keyboard and sends
output to your screen. Sometimes it is useful to redirect the input or output to a file
or a printer. For example, you might want to redirect a directory listing from the
screen to a file.
To redirect the input or output of a command, use one of the following redirection
characters:
• The greater-than sign (» sends the output of a command to a file or a device,
such as a printer.
• The less-than sign «) takes the input needed for a command from a file rather
than from the keyboard.
• The double greater-than sign (») adds output from a command to the end of a
file without deleting the information already in the file.

Redirecting the Output of a Command
Almost all commands send output to your screen. Even commands that send
output to a drive or printer also display messages and prompts on your screen.
To redirect the output from the screen to a file or printer, use the greater-than sign
(». You can use the greater-than sign with most DOS commands. For example,
in the following command, the directory listing produced by the DIR command is
redirected to the DIRLlST.TXT file:

dir> dirlist.txt
If the DIRLlST.TXT file does not exist, DOS creates it. If DIRLlST.TXT exists, DOS
replaces the information in the file with the output from the DIR command.

© Copyright IBM Corp. 1981, 1995

109

The following command creates a file named CHECKDSKTXT, which contains the
output of the CHKDSK command:

chkdsk a:

>

checkdsk.txt

If CHECKDSKTXT already exists, DOS replaces its contents with the output that
the CHKDSK command usually sends to your screen.
To add the output from a command to the end of a file without losing any of the
information already in the file, use a double greater-than sign (»). For example, in
the following command, the directory listing produced by the DIR command is
appended to the DIRLlST.TXT file:

dir » dirlist.txt
To send the output of a command to a printer, use the greater-than sign with the
name of the port to which the printer is connected. For example, the following
command redirects the output of the DIR command from the screen to the printer
attached to the LPT1 port:

dir

lptl

>

Note: Some command output, such as error messages, cannot be redirected
when using the greater-than sign (».

Redirecting the Input to a Command
Just as you can send the output of a command to a file or printer rather than to
your screen, you can take the input for a command from a file rather than from the
keyboard. To take input from a file, use the less-than sign «). For example, the
following command takes the input for the SORT command from the LlST.TXT file:

sort

<

1i st. txt

DOS alphabetizes the lines of the LlST.TXT file and displays the result on your
screen.
For more information about the SORT command, see "Sorting Text Files" on
page 112.

11 0

PC DOS User's Guide

Passing Information through Filter Commands
Filter commands divide, rearrange, or extract portions of the information that passes
through them. DOS has three filter commands:
• The MORE command displays the contents of a file or the output of a
command one screen at a time.
• The FIND command searches through files and command output for the
characters you specify.
• The SORT command alphabetizes files and command output.
To send input from a file to a filter command, use the less-than sign «). If you
want the filter command to get its input from another command, use the pipe (I).
Before using the pipe, you should set a TEMP environ~ent variable. For
information about setting environment variables using the SET command, type
hel p set at the DOS command prompt.
I

Controlling the Screen Display by USing the MORE Command
The MORE command displays the contents of a file or the output of a command
one screen at a time. For example, the following M9RE command displays the
contents of the LlST.TXT file one screen at a time:

more < list. txt
After a screen of information is displayed, you see the word More appear. To
continue to the next screen, press any key. To stop the command without viewing
more information, press CTRL+C.
The MORE command is helpful if you are working with a command that produces
more than one screen of output. For example, suppose you want to view a
directory tree for your hard disk. If you have more directories than DOS can display
on the screen, you can use the TREE command with a pipe (I) and a MORE
command as in the following example:

tree c:\

I more

The first screen of output from the TREE command is displayed, followed by the
word More. DOS pauses until you press any key (except the PAUSE key).

Chapter 8. Redirecting Input and Output

111

Searching for Text by Using the FIND Command
The FIND command searches one or more files for the text you specify. DOS
displays every line containing that text. The FIND command can be used as a filter
command or as a standard DOS command.
For information about the FIND command as a standard DOS command, type
he 1p fi nd at the DOS command prompt.
To use FIND as a filter command, include a less-than sign «) and a file name to
search through. The search is case-sensitive. For example, the following
command finds occurrences of the'string Paci fi c Rim in the file TRADE.TXT:

find "Pacific Rim"

<

trade.txt

To save the output of the FIND command rather than display it, use a greater-than
sign (» and the name of the file that is to store the output. For example, the
following command finds occurrences of Paci fi c Rim in the TRADE.TXT file and
saves them in the NWTRADE.TXT file:

find "Pacific Rim"

<

trade. txt

>

nwtrade.txt

To print the output rather than display it, use a greater-than sign and the name of
the port your printer is attached to, as in the following command:

find "Pacific Rim"

<

trade. txt

>

LPTI

Sorting Text Files
The SORT command alphabetizes a text file or the output of a command. For
example, you would use the following command to sort the contents of a file named
LlST.TXT and display the results on your screen:

sort

<

1i st. txt

In this example, the SORT command sorts the lines of the LlST.TXT file and
displays the results without changing the file. To save the output of the SORT
command rather than display it, include a greater-than sign (» and a file name in
the command. For example, you would use the following command to alphabetize
the lines of the LlST.TXT file and store the results in the ALPHLlST.TXT file:

sort

112

<

list.txt

PC DOS User's Guide

>

alphlist.txt

To sort the output of a command, type the command followed by a pipe (/) and the
SORT command. For example, the following command sorts the output of the
FIND command:

find "Jones" maillst.txt

I

sort

When you type this command, DOS lists in alphabetical order the lines in which the
,string Jones appears.
You can use the SORT command on files that are 64K or less in size. Type
hel p sort for more information about the SORT command.

Combining Commands with Redirection Characters
You can combine filter commands, other commands, and file names to make
custom commands. For example, you might use the following command to store
the names of files that contain the LOG string:

dir

/b I find "LOG"

>

loglist.txt

DOS sends the output of the DIR command through the FIND filter command and
stores the file names that contain the LOG string in the LOGLlST.TXT file. The
results are stored as a list of file names (for example, A.LOG, LOGDAT.SVD, and
MYLOG.BAT).
To use more than one filter in the same command, separate the filters with a pipe
(I). The following command would search every directory on drive C, find the file
names that include the string LOG and display them one screen at a time:

dir c:\ /s /b

I

find "LOG"

I more

Because you use a pipe (I), DOS sends the output of the DIR command through
the FIND command. The FIND command selects only file names that contain the
LOG string. The MORE command displays the file names that are selected by the
FIND command-one screen at a time.

Chapter 8. Redirecting Input and Output

113

114

PC DOS User's Guide

Chapter 9. Using COSKey and Editing Keys
You can use editing keys to quickly view and edit your last command rather than
retype it. In addition, you can use the DOSKey program to do your editing. The
DOSKEY command-line statement has been added automatically by the PC DOS
Setup program to your AUTOEXEC.BAT file. This program is loaded and ready to
use every time you start your computer. The DOSKey program includes the DOS
editing keys plus a number of other keys that are useful for editing commands.
Using the DOSKey program, you can also:
• Store the commands you use over and over again so that you do not have to
retype them to use them.
• Create macros that contain a series of commands. A macro runs much like a
batch program.

Using DOSKey to Work with Commands
You can use the DOSKey program to view, edit, and carry out DOS commands that
you have used previously. DOSKey includes the DOS editing keys and other keys
that make it easy for you to use previous commands. When using DOSKey, you
can type several commands on one line.
In addition, you can create, run, and save command macros A macro is one or
more DOS commands that are stored in random-access memory (RAM). It runs
much like a batch program. The first time you use DOSKey, it is loaded into RAM.
Thereafter, DOS saves your previous commands and any macros you create.
Although you have more editing power with DOSKey than you do with DOS editing
keys, DOSKey takes up a small amount of your computer's memory. If you need
the maximum amount of memory for other purposes, you might want to use DOS
editing keys instead of DOSKey.

Loading DOSKey Into Memory
To load the DOSKey program into memory, type the following at the DOS
command prompt:

doskey

© Copyright IBM Corp. 1981, 1995

115

Unless you indicate otherwise, DOS reserves 512 bytes of memory for the
commands and macros you record. If your average command contains 15
characters, you can store or have the ability to recall about 35 commands with the
amount of memory reserved. The resident portion· of the DOSKey program itself
occupies about 4K of memory.
Note: If your are running HIMEM.SYS, DOSkey occupies about 1K of memory.
If you want to reserve more or less memory, you can include the /bufsize= switch .
in the command. For example, to reserve 300 bytes of memory for recorded
commands, type:

doskey /bufsize=300
As the memory you reserved for DOS Key is used up, the oldest commands are
removed so that the new ones can be stored in the buffer. You can clear the buffer
by pressing ALT+F7.

Typing More Than One Command on a Line
Typically, you type one command per line. After you install DOSKey, you can type
several commands on a line. You separate each command by pressing CTRL+ T. A
paragraph mark (~) appears on your screen each time you press CTRL+T. You can
type as many commands as you like on one line as long as the total line length
does not exceed 127 characters.
For example, to delete all the files in the \TMP directory and then remove the
directory, type the following two commands on the same line:

del \tmp\*.* ~ rd \tmp
The DEL command is initiated and you are prompted to confirm the deletion. Then
the second commarid is initiated.

Viewing Previous Commands
When DOSKey is loaded, it keeps a list of your commands as you type them. You
can use the following keys to view previous commands. To carry out a command
again after it is displayed, press ENTER.

116

PC DOS User's Guide

Editing Key

Command Carried Out

UPARROW

Displays the previous command in the list.

DOWN ARROW

Displays the next command in the list.

F7

Displays the list of commands DOSKey has stored.

Fa

Cycles through the stored commands that start with the characters you
specify. (You type the search text and then press Fa).

F9

Prompts you to type the number of the stored command you want. To
see the numbered list of commands, press F7.

PAGE UP

Displays the oldest command in the list.

PAGE DOWN

Displays the newest command in the list.

ESC

Clears the command from the screen.

Viewing the List of Stored Commands
DOS Key displays a numbered list of the commands it saves. For example,
suppose you type the following three commands after you load DOS Key:

copy c:\work\*.txt c:\revised
dir c:\revised\*.txt
dir c:\work\*.txt
DOSKey saves the three commands. To view the full list of commands, press F7.
A numbered list of the commands appears:

1: copy c:\work\*.txt c:\revised
2: dir c:\revised\*.txt
3: dir c:\work\*.txt
If there are more commands in the list than can fit on one screen, DOS Key pauses
after each screen of commands. To see the next screen of commands in the list,
press any key except PAUSE.

Viewing the Previous or Next Command
The first time you press the UP ARROW key, DOSKey displays the most recent
command. You can reuse the command by pressing ENTER.
If you press the UP ARROW key more than once, DOSKey displays commands
further back in the list. To move backward in the list and view the next most recent
command, press the UP ARROW key again. Continue this process to move
backward in the list of commands.
To move forward in the list, press the DOWN ARROW key.

Chapter 9. Using DOS Key and Editing Keys

117

Viewing the First or Last Command
To view the most recent command, press PAGE DOWN. To view the oldest
command, press PAGE UP.

Viewing Other Commands in the List
You can use F9 or Fa to view a specific command in the list. Suppose DOSKey
has saved the following list of commands:

1: a:

2: di r
3: c:\myuts\figdsk a: time=30 space=35.B
4: di r
5: del *.tmp
If you want to view command number 3, you can use the arrow keys or press F9.
When you press F9, the following appears:

Line number:
To view line 3, type 3 and then press ENTER.
You can also use Fa to view a command that begins with letters you specify. For
example, to view a command that begins with C:\, type c: \ at the DOS command
prompt and then press Fa.
When you press Fa, DOS Key displays the most recent command that begins with
the characters you typed. You can press Fa again to view the next command in the
listthat begins with the characters you typed. Keep pressing Fa to cycle through all
the matching commands. If DOS Key does not find a matching command in the list,
nothing happens.

Editing and Using Previous Commands
As you type a new command or after you view a previous command, you can use
editing keys to change it. You can use the same editing keys with DOSKey that
you use with the command template. When you use some of these keys with
DOSKey, however, you see slightly different results. DOSKey provides a number of
additional editing keys that make it easy to change a previously typed command.
The editing keys affect only the displayed command; they do not change any
commands that DOS Key has already stored.

118

PC DOS User's Guide

You can use the following editing movement keys with DOSKey:
Editing Key

Movement Carried Out

HOME

Moves the cursor to the beginning of the displayed command.

END

Moves the cursor to the end of the displayed command.

LEFT ARROW

Moves the cursor back one character in the displayed command.

RIGHT ARROW

Moves the cursor forward one character in the displayed command.

CTRL+LEFT ARROW

Moves the cursor back one word in the displayed command.

CTRL+RIGHT ARROW

Moves the cursor forward one word in the displayed command.

BACKSPACE

Deletes the character before the cursor on the current command
line, without affecting the template.

DEL

Deletes the character at the cursor.

CTRL+END

Deletes all characters from the cursor to the end of the line.

CTRL+HOME

Deletes all characters from the cursor to the beginning of the line.

INSERT

Toggles between insert mode and replace mode.

ESC

Clears the displayed command from the screen.

If you hold down CTRL while you press the RIGHT ARROW or LEFT ARROW key, the
cursor moves to the beginning of the next or previous word. A word in this case is
a group of characters separated from other characters by a space. For example,
the following command has three words:

copy c:\games\suzz.exe a:_
If the cursor is at the end of the line, as in this example, you can move it to the "C"
in C:\GAMES\SUZZ.EXE by pressing CTRL+LEFT ARROW twice.
With the cursor anywhere in the word C:\GAMES\SUZZ.EXE, you can move the
cursor to the beginning of the next word by pressing CTRL+RIGHT ARROW. If you
press CTRL+RIGHT ARROW again, the cursor moves to the end of the line.
By pressing the INSERT key, you can add characters at the position of the cursor.
The INSERT key toggles between insert and replace mode. In replace mode, new
characters you type replace any characters that follow the cursor. After you press
the INSERT key, you switch to insert mode; the character at the cursor position and
the characters following the cursor move right as you type. For example, suppose
the following line is displayed, and the cursor is under the S in SUZZ.EXE:

copy c:\games\suzz.exe a:

Chapter 9. Using DOS Key and Editing Keys

119

To change the line so that C:\GAMES\SUZZ.EXE becomes
C:\GAMES\NEW\SUZZ.EXE, you press the INSERT key and type new\. The line
now appears like this:

copy c:\games\new\suzz.exe a:
To turn off insert mode, press the INSERT key again. The characters you now type
replace any characters following the cursor. Insert mode is turned off when you
press ENTER to carry out a command. You can start DOSKey and specify insert
mode as the default by using the /insert switch.
Type hel p doskey for more information about the DOSKEY command.

Deleting the List of Stored Commands
To delete the list of stored commands and begin a new list, press ALT +F7. The list
is also deleted when you reload DOSKey or reset your system.

Saving the List of Stored Commands in a Batch Program
To save the list of stored commands, you can type the DOSKEY command with the
/history switch, the output redirection character (», and the name of the file in
which you want the list stored. For example, to store your list of commands in the
SAVCOMMS.TXTfile, type:

doskey /history

>

savcomms.txt

To create a batch program by using DOSKey, first press ALT +F7 to delete the list of
commands from DOSKey. Then, type the commands you want to save. Use the
/history switch to save the commarids in a file with a .BAT extension.

Using DOSKey to Work with Macros
A macro is a set of commands that you can carry out by typing the name of the
macro. A macro is very much like a batch program. Both contain sets of
commands that you carry out by typing a name.

120

PC DOS User's Guide

A macro has the following characteristics:
• It is stored in RAM and, as a result, processes much faster than a batch
program.
• It can be run from any directory.
• The macro is created as one command or a series of commands separated by
a special character all on one line. The total length of the macro cannot
exceed 127 characters.
• You can use replaceable parameters. These are represented by the characters
$1 through $9.
• Macros are lost each time you turn your system off or reset it. This can be
avoided by putting the definition commands for the macros you commonly use
into one batch program. To make the macros available, you run the batch
program.

Creating a Macro
To create a macro, type dos key followed by the macro name, an equal sign, and
the commands in the macro. For example, to create a macro called DDIR that·
displays a directory in wide format, type:
doskey ddir=dir /w
If you type ddi r at the DOS command prompt, DOS processes the macro,
displaying a five-column list of the files in the current directory. Because the macro
is stored in memory, it does not matter which directory is current when you run it.
To include more than one command in a macro, separate the commands with a
dollar sign ($) and the letter T. For example, the following command creates a
macro called CMP that alphabetizes and lists the .DOC files and then the .BAK files
in the current directory:
doskey cmp=dir *.doc /o:n $t dir *.bak /o:n
While you are creating and testing a macro, it is easiest to type the command that
defines the macro at the DOS command prompt. Then, you can use the DOSKey
editing keys to change and redefine the macro quickly.
Because macros are stored in memory, they are lost when you turn your system off
or reset it. therefore, if you create a macro that you use often, put the command
that defines the macro in your AUTOEXEC.BAT file so the macro is available each
time DOS starts.

Chapter 9. Using ObSKey and Editing Keys

121

Running a Macro
To run a macro, type its name at the DOS command prompt. For example, to run
the DDIR macro, type:

ddir
There cannot be any space between the DOS command prompt and the macro
name. If there is, DOS does not recognize the name and displays the following
message:

Bad command or file name
Suppose you want to create a macro that has the same name as a command. You
could use the following command to create a macro called DIR so that typing di r
would replace the DOS DIR command:

doskey dir=dir /w
When you have a macro with the same name as a command, DOS runs the macro
rather than the command. Thus, when you are at the DOS command prompt, DOS
runs the DIR macro rather than the DIR command.
Whenever you want to use the DIR command instead of the DIR macro, you can
type a space between di r and the DOS command prompt. Now, DOS does not
recognize DIR as a macro name, but it does recognize it ~s a command.
You cannot run a macro from within a batch program, but you can define it in a
batch program. For more information about batch programs, see Chapter 7,
"Workin"g with Batch Programs" on page 97.
When you want to stop a currently running macro, you must press CTRL+C for
every command in the macro. Each time you press CTRL+C in a macro, DOS stops
the command it is currently processing.

122

PC DOS User's Guide'

Editing a Macro
You can change a macro by editing the command that created it. If the macro is
defined in a batch program, you can edit the batch program and then run it again.
If the macro is one of the commands that DOSKey has stored, you can redisplay
the macro command, edit it by using DOSKey editing keys, and complete the edit
by pressing ENTER. For information about DOSKey editing keys, see "Editing and
Using Previous Commands" on page 118.

Saving a Macro
To save macros stored in memory, use the DOSKEY command with the /macros
switch, a greater-than sign (», and a file name. In the following example, the
names and contents of the macros currently in memory are stored in the
MACS. BAT file:

doskey Imacros

>

macs.bat

If you add the DOSKEY command to the beginning of each macro that you saved
in the MACS.BAT file, you can load the macros into memory by running the batch
program. For example, suppose you created the following three macros and saved
them in the MACS.BAT file:

ddir=dir loe Ip
mv=copy $1 $2 $t del $1
where=dir Is Ip $1:\*.$2
If you want these macros to be available each time you start your system, first add
the DOSKEY command to them, as follows:

doskey ddir=dir loe Ip
doskey mv=copy $1 $2 $t del $1
doskey where=dir Is Ip $1:\*.$2
Each time you run the batch program, DOSKey loads the three macros into
memory. You might want to run the batch program from your AUTOEXEC.BAT file
by using the CALL command. Put the name of the batch file after the CALL
command. When you start your system, the macros are re-created. For more
information about the AUTOEXEC.BAT file, see Chapter 4, "Configuring Your
System" on page 53.

Chapter 9. Using DOS Key and Editing Keys

123

Deleting a Macro
To delete a macro, type doskey, followed by the name of the macro you want to
delete plus an equal sign. For example, to delete the DDIR macro, type:

doskey ddir=
DOS Key removes the macro from memory., To delete all macros, press ALT +F1 o.
Deleting macros makes the memory available for other macros, but it does not
return the memory to the command-history buffer.

Using Replaceable Parameters
You can use replaceable parameters in a macro in much the same way you use
them in a batch program. In a macro, the replaceable parameters are $1 through
$9 rather than %1 through %9.
For example, the following command creates a macro named FINDIT that searches
through the directories on drive C for file names that match the one you specify:

doskey findit=dir c:\$1 /s
The /s switch is used to display file names from all directories on drive C (including
the current directory) that match the file name you specify.
To run this macro, type fi ndi t followed by a file name at the DOS command
prompt. For example, to locate all files on drive C that have the extension .OLD,
type:

findit *.old
DOSKey substitutes the file name you type for the $1 parameter in the macro. The
resulting command looks like this:

dir c:\*.old /s
You can use the same parameter more than once in a macro. For example, the
following command creates a macro called DDEL. This macro moves a file to a
directory named DELETED on drive C.

doskey ddel=copy $1 c:\deleted $t del $1

124

PC DOS User's Guide

When you run the DDEL macro, you type the name of the file that is to go into the
C:\DELETED directory. DOSKey replaces the $1 in the macro with the file name.
It copies the file to DELETED and then deletes it from its original directory.
To delete the files in the C:\DELETED directory, you can use this macro named
CLEANUP:

doskey cleanup=dir c:\deleted $t del c:\deleted\*.*
The macro displays a list of files in the C:\DELETED directory and then starts the
DEL command. Because the DEL command prompts you to confirm deletion of all
the files, you have a chance to review the file names before deleting any files.

Using the $* Replaceable Parameter
You can use the $* replaceable parameter to assign to a single parameter all of the
text following the command that starts a macro. Typically, DOS distinguishes
parameters by looking for a space. The text between the first two spaces is the
first parameter, the text between the second and third spaces is the second
parameter, and so on. If you use the $* parameter, DOSKey ignores spaces and
assigns all text to the $* parameter.
The $* parameter is most useful when the macro you create uses a variable
number of parameters. For example, you can use the following command to create
a macro named D that allows you to abbreviate the DIR command:

doskey d=dir $*
This macro works exactly like the DIR command, regardless of the number of
parameters you specify. For example, all of the following commands are carried
out in the same way with the D macro as they are with the DIR command:

d *.txt
d *.txt /5
d *.txt /5 /b
If you use the $1 parameter instead of the $* parameter with the macro, DOS
substitutes the first parameter and ignores the rest of the command line.

Chapter 9. Using DOS Key and Editing Keys

125

Redirecting Input and Output
You redirect input and output in macros the same way you do using DOS
commands. The only difference is that macros require different characters:
Character

Redirection

$L (or $1)

Equivalent to the less-than sign
command.

$G (or $9)

Equivalent to the greater-than sign (». It redirects the output
from a command.

$G$G (or $9$9)

Equivalent to the double greater-than sign (»). It appends output
onto the end of a file.

$8 (or $b)

Equivalent to the pipe (
to another.

I ).

«).

It redirects the input to a

It redirects output from one command

For example, the following command creates a macro named PDIR that prints
directory listings:

doskey pdir=dir $g lpt1:
The following command creates a macro named MTYPE that displays the contents
of the file you specify and pauses between each screen of information:

doskey mtype=type $1 $b more
The following command creates a macro named ASORT that alphabetizes the file
and stores the information in a different file:

doskey asort=sort $L $1 $g $2
To run this macro, you type the file name you want to sort. DOSKey replaces the
$1 replaceable parameter with the first file name you specify. The $L parameter
redirects the file to the SORT command. The $9 and $2 paramE11ers redirect the
output of the SORT command to the second file you specify.
For example, after you create the ASORT macro, type the following:

asort input.txt output.txt
This is the same as typing:

sort

126

<

input.txt

PC DOS User's Guide

>

output. txt

When defining a DOSKey macro, you must mark the dollar sign ($) when it occurs
anywhere other than in parameters, command separators, and redirection
characters. You mark it by typing two dollar signs rather than one.
For example, suppose your macro copies a file to the $&CENTS directory. When
you type the name of the directory, you must use "$$¢s" in your macro
definition. As the command is carried out, the dollar sign is assumed to be a
standard character rather than a marker or parameter.

Using DOS Editing Keys
This section describes the editing keys you can use if you do not have the DOS Key
program loaded in your AUTOEXEC.BAT file. Because the PC DOS 7 Setup
program installs the DOSKEY command for you, you will need to remove or
comment out (REM) the DOSKEY command-line statement in your
AUTOEXEC.BAT file before you can use the DOS editing keys or any other
third-party command retrieval program.
DOS provides several editing keys that you can use to edit the last command you
typed at the command line. For example, suppose you misspell the name of a file
in a COPY command. Rather than retype the entire command, you can use editing
keys to view the command and change the part that is misspelled.
When you type a command, DOS carries out the command and saves it in a
temporary location called the template. For example, suppose you type:

type ada. txt
When you press ENTER, DOS displays the contents of ADA.TXT and copies the
command type ada. txt to the template. The template can contain only the
previously typed command. For information about saving and reusing more than
one command, see "Using DOSKey to Work with Commands" on page 115.

Chapter 9. Using DOSKey and Editing Keys

127

You can use the command stored in the template as a starting point for typing your
next command. The following editing keys display and edit the previous command
stored in the template:
Editing Key

Command Carried Out

F1 (or RIGHT
ARROW)

Copies the previous command to your screen, one character at a time.
One character is displayed each time you press F1. For example, if
your last command was dir c:\work\finals\*.bak, by pressing F1
three times, di r is displayed at the DOS command prompt.
To add a character, press,the INSERT key, type the character, and
press F1 to display the rest of your command one character at a time.

F2

Copies the 'previous command to your screen, up to but not including
the character you specify. For example, dir c:\worknew\final was
your last command. If you press F2 and type \, di r c: is displayed at
the DOS command prompt.

F3

Copies the remainder of the previous command to your screen.

F4

Deletes the previous command from the template, starting from the
beginning of the command, up to but not including the letter you specify.
For example, if type ada. txt was the previous command, press F4 and
type d before pressing F3 to copy the template to your screen. DOS
displays da. txt at the DOS command prompt.

F5

Copies the current command line to the template but does not carry out
the command.

F6

Places a CTRL+Z character ("Z) in the current command line.

LEFT ARROW or
BACKSPACE

Deletes the character before the cursor on the current command line,
without affecting the template.

DEL

Deletes the character on the template corresponding to the current
cursor position.

INSERT

Starts insert mode so that characters you type do not replace
characters in the same position in the template. Press the INSERT key
again to stop insert mode.

ESC

Cancels the current command line without carrying it out, leaving the
template unchanged.

Note: Some of these keys function differently when DOSKey is loaded.

128

PC DOS User's Guide

Copying a Previously Typed Command
When you type a command, DOS carries it out, copies the command to the
template, and displays the DOS command prompt. For example, suppose you
type:

copy c:\work\*.txt a:
The files are copied to a diskette in drive A, the command is copied to the template,
and the DOS command prompt appears. At this point, you can view the entire
previous command by pressing F3. The command from the template is displayed:

copy c:\work\*.txt a:_
The cursor appears at the end of the command. To copy your files to another disk,
insert a different disk in drive A and then press ENTER. DOS carries out the COPY
command again.

Editing a Previously Typed Command
Using F3 and the LEFT ARROW key, you can quickly fix a command that you
mistyped. For example, suppose you typed *. dpc and pressed ENTER when you
meant to type *. doc, as in the following command:
copy c:\work\*.dpc a:
Rather than retype the command, you can edit the incorrect one. To edit the
command, first press F3. The command from the template is displayed:

copy c:\work\*.dpc a:_
The cursor appears at the end of the command. To change dpc to doc, press the
LEFT ARROW key five times to move the cursor back five spaces:

copy c:\work\*.d_
To correct the command, type

0,

press F3, and then press ENTER.

Chapter 9. Using DOS Key and Editing Keys

129

130

PC DOS User's Guide

Chapter 10. Working with the Text Editor
The E Editor is the text editor provided with PC DOS. A text editor allows you to
create, edit, and print memos, letters, and special files (such as AUTO EXEC. BAT or
CONFIG.SYS) that customize DOS. For prior users of the E Editor, you will find
the E Editor provided with PC DOS 7 has many new enhancements.
The E Editor that comes with PC DOS, is not intended to take the place of a word
processing program. While some word processing function may be noticed, the
E Editor is not intended to be a substitute for your word processing program. For
readers who are interested in comparing the differences of a text editor to a word
processing program, see "Comparing a Text Editor and a Word Processing
Program" on page 172.

What's New about the E Editor for PC DOS 7
PC DOS 7 introduces many new features and enhancements to the E Editor.
Some that will prove beneficial are:
• Menu selections for most of the tasks you perform with a text editor.
• The ability to use a mouse to make selections and mark text.
• Improved use for the F11 and F12 keys on an enhanced keyboard to switch
between loaded files. If you do not have an enhanced keyboard, you can use
the key combinations of CTRL+P or CTRL+N.
• The ability to browse a file in read-only mode so that you do not inadvertently
change or delete it.
• An editable E.INI file that allows you to customize most functions of the
E Editor There is no need to reboot after making changes to the E.INI file; exit
the E Editor for changes to take effect.
• Syntax-directed editing for REXX and C files.
• Expanded math capabilities so that you can work with larger numbers, including
- binary numbers.

© Copyright IBM Corp. 1981, 1995

131

Choosing a Text Editor
The E Editor:
Using the E Editor, you can type commands from the E Editor command line or
use the menus to do selected editing tasks. Some of the things you can do are as
follows:
•
•
•
•
•
•
•
•
•
•

Select text and move, copy, overlay, or delete it.
Copy and move text from one file into another file.
Access multiple files.
Locate and make a change globally in a file.
Size and drag an editing window.
Draw boxes around text.
Add and multiply numbers in a marked area.
Change characters in a marked area to all uppercase or all lowercase letters.
Edit large text files.
Use online help for information about the E Editor function keys and
commands.

This chapter only discusses how to use the E Editor. It does not give instructions
on using the EDLIN text editor or the DOS 5.0 text editor.

The EDLIN editor:
EDLIN is a line editor included in previous versions of DOS. If you are upgrading
your version of DOS, the EDLIN editor is not removed from your system so it is
also available to use as a text editor.
The DOS 5.0 Editor:
When you install this version of DOS, it analyzes your system and determines if you
have a previous version of DOS on your system. If you are a previous user of
DOS 5.0, the DOS editor provided with DOS 5.0 will still be available for your use.
If you prefer to use this editor, you can type edi t at the DOS command prompt
(C:>\) followed by the path and name of the file you want, to load the DOS 5.0
Editor.

132

PC DOS User's Guide

Starting the E Editor
You can start the E Editor by typing e (or e followed by the path and name of the
file) at the DOS command prompt.
When you load the E Editor, you have the option of using the E Editor command
line for all your editing tasks or using the menus to perform selected editing tasks.
If you use the E Editor command line, you need to press ESC to switch between
the command line and the editing window.

Viewing the E Editor Screen
After you start the E Editor and begin typing, the version number displayed is
replaced by the function keys at the bottom of the screen and you see a screen
similar to the following:
Text Input Area
(expands as you enter text)

====== Top of

file~

====== Bottom of file ======

Command Line

F1=Hel

2=Save

3=Close

4=File

Line
5=Print

Z Col
7=Hename

1 Insert
8=0 en 9=Undo

E 3.13
10=He

Reminder Line
Function Keys
(switches to
Information line)

Reminder Line
The bottom line of the E Editor screen displays a brief reminder of each action
associated with the function key (or F keys, such as F1 =Help and F2=Save). You
can perform the most common editing tasks with one keystroke.

Chapter 10. Working with the Text Editor

133

Function Key

What It Does

F1=Help

Accesses help information about function keys and editing
commands. You can page through this help Information using the
PAGE UP and PAGE DOWN keys.

F2=Save

Saves the file you are editing but does not exit the file.

F3=Close

Removes your file's text from memory without saving it. If your file
has been modified, you will be asked whether you really want to
close the file without saving. When there are no remaining files in
memory, you exit to DOS.

F4=File

Saves your file and quits the E Editor after saving. When there are
no remaining files in memory, you exit to DOS.

F5=Print

Lets you print a file.

F6=Draw

Starts the drawing text graphics feature. Then you type a number (1
through 6), B for blank, or / followed by any character. You can
create or erase text graphic drawings by moving around with the
cursor keys. See "Drawing Lines" on page 163 for more information.
This function key and associated action is not displayed on the
reminder line. However, it is active.

F7=Rename

Lets you change the name of the file you are editing. Type the new
name and press ENTER. Afterwards, press ESC to return the cursor
to the text area; this does not change the name of the previous copy
on disk. It changes the name of the file to be saved. Renaming is a
good way to begin a revised copy without losing the original file.

F8=Open

Lets you open another file or more than one file at a time. Type a
filename, cursor to the text area so you can begin editing this second
file. You can enter more than one file name separated by a space
and can specify wild cards in file names (for example, *.doc or *.c.).
Press F11 or F12 on an enhanced keyboard to switch between the
multiple files you are editing. If you do not have an enhanced
keyboard, you can use the selections on the menu for options (for
example, Next file or Previous file). or press CTRL+P (Previous file)
and CTRL+N (Next file).
Do not select F8=OPEN to edit your current file.

F9=Undo

Restores the original contents of a line you typed incorrectly. Undo
does not restore deleted lines or changes to multiple lines. Only the
current line you are editing can be restored.

F1o=Menu

Jumps to the menu. Then the arrow keys can be used to move from
selection-to-selection and to access the associated menus.
From a menu, you can use mnemonics to make selections.

134

PC DOS User's Guide

Function Key

What It Does

F11 =Previous

Accesses the previous file you have worked on when you have
loaded multiple files in the E Editor. This key is available only on an
enhanced keyboard.
This function key and the associated action is not displayed on the
reminder line. However, it is active.

F12=Next

Accesses the next file in the ring when you have loaded multiple files
into the E Editor. This key is available on an enhanced keyboard.
This function key and the associated action is not displayed on the
reminder line. However, it is active.

The reminder line, called the function key text area, changes when you hold down a
SHIFT, CTRL, or an ALT key to show you the function key text appropriate to that
shifted state.

Information Line
You also can see the name of the file you are editing, location of the cursor (line
number and column number), working mode (insert, replace, or browse), and the
version number of the E Editor.

Command Line
The command, line can be found near the bottom of the E Editor screen. To jump
the cursor from the typing area to the command line, press ESC. Press ESC again
to return to the typing area.

Window Style
You can change the location of the reminder line, the information line, and the
command line by selecting a different window style. See "Customizing the
E Editor" on page 169 to learn how to alter the appearance of the editing screen
and to use other customization techniques.

Chapter 10. Working with the Text Editor

135

Getting Help
To get information about the E Editor after the editing window appears, press F1 to
display help information.
,

;

- - Top of f i l e - II

II L LUltor Help

,

"

.

,,

.,

ctory of Help Panels

Page
1-2
3-4
5-6
7-8
9-13
14

15
16
17-18

Cursor Movement and Mouse Actions
Function Key Summary
Alt+Key Summary
Ctrl+Key Summary
Command Summary
Edit Commands
Termination Commands
Copying. Moving. and Deleting text
ASCII conversion table

C:\DOS\EHELP.HLP
F3=Close F5=Print

Keys: 1. l.

... -',

Line
1 Col
1 Browse
Ilome. End, PayeUu, PaueDown

E 3.131.
F10=l1enu

When you access the E Editor online help, you are automatically put into browse
mode. It is not possible to edit the help file in browse mode. You can use the
arrow keys to scroll right, left, up, or down. In addition, you can use HOME to move
your cursor to the top line of the file or END to move the cursor to the bottom line of
the file.
You can use the PAGE UP and PAGE DOWN keys to move forward and backward
through the help screens.
To exit the online Help file, press F3.

136

PC DOS User's Guide

Leaving the E Editor
You can stop editing and exit from the E Editor three ways: close (without saving
changes), file (saving changes), and exit.
F3=Close

Removes your file's text from memory without saving it. If your file
has been modified, you will be asked whether you really want to
close the file without saving.' When there are no remaining files in
memory, exit to DOS.

F4=File

Saves your file and removes it from memory. When all files are
removed from memory, you exit to DOS.

ALT +F4=Exit

Exits the E Editor after closing all files. You are given the option of
saving your changes if necessary. You are returned to the DOS
prompt.

Creating or Modifying a File
You can use the E Editor to create a new text file or modify an existing file. For
example, try entering some lines of text in a file named REPORTS.TXT in your root
directory. Type the following at the DOS command prompt:
e c:\reports.txt

and press ENTER
You must always type the full path of the file unless you started the E Editor from
the directory where you eventually want the file to be placed.

You see the editing window. Your directory path and file name are displayed at the
bottom of the screen. For descriptions of the parts of an E Editor screen, see
"Viewing the E Editor Screen" on page 133.
1. Begin typing your text from where the cursor is positioned. Try typing the text
in the following example:
The following reports are required for the staff meeting on Friday:
1. Weekly Status Report
2. Funding Report

The default margins are set at 1 and 254. When you reach 254, the text
automatically wraps to the next line.
As you enter the text, note that the Line and Col numbers change near the
bottom of the screen.
2. Save and file the information as C:\REPORTS.TXT by pressing F4.
You see Savi ng

c: \REPORTS. TXT flash at the bottom of your screen.
Chapter 10. Working with the Text Editor

137

If you do not specify the full path and file name when you load the E Editor,
your file will be saved to the same drive and directory you were at when you
created the file.
You can change it by typing save followed by a new drive, directory, or file
name. If you were in the C:\OFFICE\NOTES subdirectory when you typed
e reports. txt, your file is saved as C:\OFFICE\NOTES\REPORTS.TXT instead
of C:\. If you want to save the file to this directory, you would type the following
at the E Editor command line:

save c:\reports.txt
3. Press ENTER.
After leaving the E Editor, you are returned to a command line.

Naming an Unnamed File
If you type only e at the DOS command prompt without specifying a file name, you
see . Unnamed fi 1e near the bottom on the left side of the screen.
To name the unnamed file:

1. Press F7=Rename if you loaded an unnamed file by typing e without a file name.
You are prompted to enter a name for the file on the E Editor command line.
Enter a file name after Rename on the E Editor command line.
Remember: Be sure to include a full path name (drive, directory, and
subdirectory, if applicable) where you want to find this file when you exit the
E Editor. Unlike word processing programs that always place-files in a specific
directory, you must specify the exact location where you want to place this file.
Otherwise, the file is put in the same drive and directory as you were in when
you loaded the E Editor.

2. Save and file under the new name by pressing F4.
In addition to creating a new file and editing an existing file, you can also save and
print files using the E Editor.

Saving and Exiting a File
After you create a file or make changes to an existing file, you can save it using a
new name or you can save it using the name you specified when you opened the
file. You also can save it with the same file name or new file name in a different
drive or directory.

138

PC DOS User's Guide

It is a good idea to save your work in case there is a power loss or equipment
failure by pressing F2 often during the editing session. Also, the E Editor has an
"autosave" feature. You can activate this feature using the Options menu or you
can type autos ave followed by a number at the E Editor command line. Your file is
temporarily saved to a file after you press ENTER the number of times equal to the
number you typed after the word "autosave".

CAUTION:
Some files that you open might include special formatting characters. If you
save such a file when using the E Editor, special characters lose their
formatting function.
To save the file
and exit using the
same file name:

• Press F4 to save the file and exit.

To save the file
and exit using a
different file
name:

1. Press ESC to get.to the E Editor command line.

The file is saved in the same drive and directory you were in
when you started the E Editor or where you specified the path.

2. Type:

file newname.ext
where newname.ext is the new file name and extension for the
file you are saving.

Remember: If you attempt to save a file using the name of a file
that already exists, the E Editor will not display a message
asking whether you want to replace the existing file.
To save the file in
a different drive
or directory and
exit:

1. Press ESC to get to the E Editor command line.
2. Type:

file drive:\dir\filename.ext
where drive:\dir is the new drive and directory where you want to
store the file, and filename. ext is the name you want to give the
file. The name can be the same name or a new name.

Remember: If you attempt to save a file in a directory that
contains a file with the same name, you are not prompted and
asked whether you want to replace the existing file.

Tip: You can save a modified version of a file without losing the original version.
For example, if you have a file named MEMO.TXT, you can keep the original file
and save a modified version as MEMO_2.TXT.

Chapter 10. Working with the Text Editor

139

Editing Multiple Files
One advantage you have with the E Editor over other text editors is the ability to
open and edit more"than one file at a time. This ability to edit multiple files means,
for example, that you can create a new file and copy (or move) information from an
existing file into the new file. Or, you can edit multiple new files, multiple' existing
files, or any combination of new and existing files. The files are placed into
memory in a type of invisible ring, and you can switch between all files in the ring
by pressing F11 or,F12 on an enhanced keyboard. If you do not have an enhanced
keyboard, you can select Previ ous fi 1e or Next fi 1e from the Options menu. Or"
you can press CTRL+N to see the next file or press CTRL+P for the previous file.

To edit more than one file at a time:
Open a file from the DOS command prompt by typing the E command from the
DOS command prompt.
Here are some sample commands you might type:
C:\>e report. txt

In this first example, the E Editor loads the file
REPORT.TXT you created earlier in the chapter into the
E Editor.

C:\>e report. txt data.dat

In this second example, two files are loaded into the
E Editor. Use F11 or F12 on an enhanced keyboard to
switch between files that are loaded for editing.

C:\>e *.c

In this third example, all the files with the C extension are
loaded into the E Editor.

While one file is opened, you can open another file by pressing FB, and then typing
either a new file name and path if creating a file, or typing the file name and path if
modifying an existing file.
From the E Editor command line, the equal sign (=) substitutes the current file's
directory and saves keystrokes if you are editing several files in another directory.
File names must be separated by spaces. For example:
Your current directory is C:\EDIT
The current file is C:\MYDOC\PROG\DOUG.DOC
You issue the command: EDIT = TODD.TXT
The E Editor loads C:\MYDOC\PROG\TODD.TXT

140

PC DOS User's Guide

Printing a File
You can use the E Editor PRINT command or press F5 to print an open file or just
the marked text within the file. In either case, the printer must be connected to or
redirected through your printer port. You can specify which printer port you want to
use by editing the E.INI file. Refer to information about the E.INI file in the online
PC DOS 7 Command Reference.
To print a file:

1. Edit the file you want to print. You can use REPORTS.TXT as a file you want
to print.
2. At the E Editor command line, type:

print
or press F5.

3. Press ENTER.
If your file has marked text, the following message is displayed:

, Print marked area or entire file (M/F)?
Type the applicable letter designator and press ENTER.
The readiness of the printer is tested first to avoid having to wait for a device
time-out in case the printer is offline. You might see the message:

Printer not ready
which means the printer is turned off, offline, or perhaps out of paper. Make
sure the printer is ready and then repeat the PRINT command.

Using Cursor Movement Keys to Move Around in the Text File
When you load an existing file into the E Editor, your file appears on the screen
and the cursor is placed in the top, far-left position in the text. To view a different
part of the file, you have to move the cursor.

Chapter 10. Working with the Text Editor

141

Summary of Cursor Movement Keys
Cursor Movement
Key

Action

UPARROW

Moves cursor one line up.

DOWN ARROW

Moves cursor one line down.

LEFT ARROW

Moves cursor one character to the left.

RIGHT ARROW

Moves cursor one character to the right.

HOME

Moves cursor to column 1 of the current line.

END

Moves cursor to end of the current line.

PAGE UP

Shifts view to page above current page. The cursor stays at same position
on screen.

PAGE DOWN

Shifts view to page below current page. The cursor stays at same position
on screen.

CTRL+HOME

Moves cursor to top line of file.

CTRL+END

Moves cursor to bottom line of file.

TAB

Moves cursor to next tab stop.

SHIFT+TAB

Moves cursor to previous tab stop.

CTRL+PAGE UP

Moves cursor to top of screen.

CTRL+PAGE DOWN

Moves cursor to bottom of screen.

CTRL+LEFT ARROW

Moves cursor to beginning of word left of cursor.

CTRL+RIGHT ARROW

Moves cursor to beginning of word to right of cursor.

ENTER

Defined by the user in the E.INI file.

CTRL+ENTER

Defined by the user iri the E.INI file.

ESC

Moves cursor back and forth between text and E Editor command line.

ALT+E

Moves cursor to end of marked block.

ALT+Y

Moves cursor to beginning of marked block.

CTRL+F5

Moves cursor to beginning of a word.

CTRL+F6

Moves cursor to end of a word.

CTRL+F

Moves cursor to next found text.

(repeat FIND)
CTRL+N

Moves cursor to the next active file in the ring.

CTRL+P

Moves cursor to the previous active file in the ring.

CTRL+Q

When in .ALL file, positions cursor on corresponding line in original file. If
not in .ALL file, you are placed there and the cursor is moved down one
line.

You can also scroll by holding down an arrow key. For additional information about
the .ALL file and the ALL command, see "Searching for Text Using the ALL
Command" on page 159.

142

PC DOS User's Guide

Performing Basic Editing Tasks
In addition to entering text, there are basic features that most text editors perform,
such as:
•
•
•
•
•
•
•
•
•

Inserting or replacing text.
Connecting or breaking a line of text.
Adding a blank line.
Deleting all or only part of a line.
Deleting characters, words, or lines of text without marking them first.
Restoring a deleted line.
Setting tabs.
Setting margins.
Saving keystrokes in a macro.

Inserting or Replacing Text
The E Editor ~as two modes for entering text: insert mode and replace mode.
Press the INSERT key to alternate between modes.
To insert text:

Position the cursor at the point where the next text is to start and
type it in. Existing text moves to the right to make room for what you
type.
When you start the E Editor, it is automatically in insert mode. At
the bottom right-hand corner of the E Editor screen, you see the
word "Insert." Press the INSERT key if you want to change to replace
mode.
In insert mode, the cursor is a box shape.

To replace text:

Press the INSERT key to replace characters instead of inserting them.
At the bottom right-hand corner of the E Editor screen, you now see
the word "Replace."
Position the cursor at the point where the next text is to start and
type it in. Existing text is overwritten when you type. Press the
INSERT key again to resume inserting.
In replace mode, the cursor is an underscore.

Connecting or Breaking a Line of Text
The way to break lines at a certain point in the text is to split (breaking) t~em.
Other times you might want to join (connecting) two or more shorter lines into one
line of text. The E Editor allows you to split or join a line by selecting Sp 1it 1i ne
or Joi n 1i nes from the Edit menu, or using the E Editor command line as follows:

Chapter 10. Working with the Text Editor

143

To break lines:

Position the cursor at the point where you want to split the line and
press ALT+S. The text after the point where you put the cursor is
now on the next line.

To connect lines:

Position the cursor anywhere on the line where you want the text to
continue or be connected and press ALT+J. The line of text just
below the cursor is now brought up to join the line the cursor is on.

You can also split a line by pressing ENTER at any spot within the text line if you
are in STREAM mode. Refer to STREAM mode under E.INI in the online
PC DOS 7 Command Reference. All the words following the cursor are moved to
the next line. If you are at the end of a line or on the first character of a line and
press ENTER, a blank line is inserted.

Adding or Deleting Lines of Text
Basic tasks you can perform using a text editor are to add a line or to delete all or
part of a line of text.
Most functions of the E Editor are controlled by the specifications designated in the
E.INI file. Two such functions, STREAM and ADDLlNE, affect the way lines are
added when using the E Editor. The E Editor is installed with STREAM mode
being the default. You can change the mode to ADDLINE by editing the E.INI file.
For more information, refer to the online PC DOS 7 Command Reference under
the discussion for the E.INI file.
To add a blank
line in STREAM
mode:

Move the cursor to the end of the line and press ENTER. This is the
default.

To add a blank
line in ADDLINE
mode:

Position the cursor anywhere in the line just above the row where
you want to add the line and press ENTER.

To erase to the
end of the line:

Position the cursor anywhere on the line to the left of what you want
to erase and press CTRL+E. The text to the end of the line is now
erased.

To delete a line:

Place the cursor in any column on the line to be deleted and press
CTRL+BACKSPACE simultaneously.

The line is deleted from the screen and the lines below it move up to
fill the gap. Continuing to press CTRL+BACKSPACE deletes multiple
lines. '

144

PC DOS User's Guide

Restoring a Deletion
Press F9 if you incorrectly type a change to a line and you want to restore its
original contents.
The contents are restored only for the current line you are editing and only if you
have not:
• Moved the cursor from the current line.
• Pressed ENTER.
The UNDO command does not restore deleted lines or changes to multiple lines.

Recovering Deleted Lines or Line Blocks
If you delete a line or block of lines (using CTRL+BACKSPACE or ALT +0), you can
recover the deletion by pressing CTRL+U. The default for the number of lines that
can be restored is set at 50. This number can be changed by editing the E.INI file.
For more information about the E.INI file, see the online PC DOS 7 Command
Reference.

Deleting Unmarked Characters or Words
You can delete text one character at a time, one word at a time, one line at a time,
or several lines at a time in blocks at one time.
To delete a
character:

Place the cursor on the character you want to delete and press
DELETE.

The character is deleted from the screen and the text to the right of
the cursor shifts to the left to fill the gap.
To delete multiple characters, repeat the steps for each character
you want to delete.
To backspace
over a character:

Press BACKSPACE.
The character to the left of the cursor is deleted from the screen and
the text to the right of the cursor shifts to the left to fill the gap.
By pressing the BACKSPACE repeatedly, characters continue to be
deleted.

To delete a word:

Position the cursor at the beginning of the word to be deleted and
press CTRL+D.
The word is deleted from the screen and the text'to the right of the
cursor shifts to the left to fill the gap. Repeat the steps to delete
multiple words.
A text editor assumes a "word" to be a string of characters from the
point where your cursor is positioned up to and including the first
following space.
Chapter 10. Working with the Text Editor

145

If you have multiple characters, words or lines to delete, you might find it easier to
mark words, lines, or blocks for deletion instead (see "Marking Text Using Key
Combinations" on page 149).

Setting Tabs
The changes to Tabs and Margin settings described in this section apply only to the
current session. The Tab and Margin settings revert to the default values when you
leave the session.
Use the TAB key to move the cursor across the screen and insert text at set points.
To change the tab settings:
1. Press ESC to move your cursor to the command line.
2. Type the TABS command on the E Editor command line.
If you only type tabs, the current tab settings are displayed. The tabs are
preset to every eighth column across the screen. For example:

tabs 1 9 17 25 33
3. Change the tab setting with the TABS command using the following format:

tabs

[t1 [t2 [t3 ... t32] ] ]

For example, you can reset tabs for specific tab stops by typing the following at
the E Editor command line:

tabs 4 17 39 47 ... 55
and then pressing ENTER.
or

You can type the TABS command followed by a number to set the tabs to
every fourth column across the screen:

tabs 4
In this example, the tabs are set at 1 5 9 13 ... 125.

Setting Margins
To set new margins:
1. Press ESC to move your cursor to the command line.
2. Type the MARGINS command on the E Editor command line.
If you only type margi ns, the current margin settings are displayed. For
example:

margins 1 254 1
146

PC DOS User's Guide

3. Change the margin setting with the MARGINS command using the following
format:

margins

[left margin [right margin [new paragraph margin]]]

For example, you could type margins similar to:

margins 1 78 5
Then press ENTER.
To put the cursor back in the text area, press ESC. As you continue typing, the
E Editor keeps your text within the new margin settings. Notice that your
previously entered text is not automatically reflowed to the new margin settings.
4. Press ESC to move your cursor to the command line.

Saving Keystrokes in a Macro
You can record and play back any sequence of keystrokes. Such a recorded
sequence constitutes a temporary macro that can be repeated numerous times. If
you find yourself entering the same key sequence more than twice, record them
instead.

To record a sequence of keys:
1. Press CTRL+R.
2. Type your sequence of keys.
Virtually any key can be recorded, including ESC, to switch to the E Editor
command line. As you are recording the keys, the key operations are also
taking place in addition to being recorded and saved.
3. Do one of the following when prompted:
CTRL+R

Finishes the recording of keystrokes.

CTRL+T

Completes the recording and immediately runs the saved sequence.
This shortcut eliminates having to press CTRL+R a second time
before pressing CTRL+ T.

CTRL+C

Cancels saving the keystroke sequence.

To replay the sequence at any other time:
Press CTRL+T.
Unless you have changed keystroke recordings, made a new recording, or left the
E Editor, the keystroke recording is retained.

Chapter 10. Working with the Text Editor

147

You can save your macro when you exit the E Editor and have it loaded the next
time you start the E Editor by setting the MACROPATH option in the E.INI file.
Refer to the online PC DOS 7 Command Reference for more information about the
E.INI file.

Selecting Text
You begin most editing operations by selecting a block of text. In a single line, you
can select any amount of text, from a single character to the entire line. You can
also select several lines or the entire file at once.
In the E Editor, selecting a section of the text is called marking the text. When this
is done correctly, you see the area you have marked highlighted on your screen.
To copy, move, or delete a section of text, first mark the text before you can
perform functions on it.
Unmarking the text removes the highlighting and the text is no longer selected.

There are two ways to mark text. You can use the mouse or you can use key
combinations

Marking Text Using the Mouse'
The following type of marking is possible when using the mouse:
Word Mark

Use the right mouse button and click on the word you want marked.

Line Mark

Hold down the right mouse button and drag the mouse pointer
across the lines of text you want to mark. An entire line, from
column 1 to column 255, is marked.

Text Mark

Ensure that the SCROLL LOCK key is off. Hold down the left mouse'
button and drag the mouse pointer across the lines of text you want
to mark. The mark proceeds only to the en'd of the line. It does not
go all the way across the screen unless your line of text projects out
that far.

Rectangular
Block Mark

Press the SCROLL LOCK key so that it is on. Hold down the left '
mouse button and drag it across the area you want to mark. Only a
rectangular area of text is blocked.

Double clicking on a marked area with the left mouse button unmarks the marked
area.

148

PC DOS User's Guide

Marking Text Using Key Combinations
Four types of marks are recognized in the E Editor:
Word Mark

Marks the entire word regardless of where you place your cursor on
the word.

Line Mark

An entire line from column 1 up to and including column 255 is
marked.
Use line mark if you are going to copy or move text and then insert
the text elsewhere in the file. Only the line mark moves the existing
text down to let you insert the text. With line mark, no text shifts to
the right. You are not required to add blank lines before you insert
the moved or copied block of text.
This is the recommended method for marking paragraphs if you are
not using the mouse.

Text Mark

Marks a single space or multiple spaces that include text, numbers,
or symbols. The marked area proceeds from where you set your
cursor to begin the mark to where you set your cursor to end the
mark. If you cross multiple lines, the marked area follows the path of
the line and goes only as far-right as the text on that line.

Rectangular
Block Mark

A strictly rectangular area of text.

To mark a line of text:
1. Use the arrow keys or other cursor movement keys to move the cursor
anywhere on the line you want to select or line mark.
2. Press the line combination keys ALT +L.

To mark multiple lines of text:
After you mark a line, move the cursor to another line and press the line
combination keys (ALT+L) again. All lines between the first mark and the second
mark are then marked.

To mark a rectangular block of text:
1. Use the arrow keys or other cursor movement keys to move the cursor to the
upper-left character of the text you want to select or block mark.
2. Press ALT +B.
3. Move the cursor to the lower-right character of the text you want to block mark.
4. Press ALT+B again to complete the block mark. The text you have marked is
now highlighted.
Chapter 10. Working with the Text Editor

149

To mark a word:
1. Use the arrow keys or other cursor movement keys to move the cursor
anywhere on the word you want to select or word mark.
You can mark only one word when you use the following key combination. You
must unmark the word or use the delete edit process to mark another word.
2. Press the word combination keys ALT+W.
To mark text:
1. Use the arrow keys or other cursor movement keys to move the cursor to the
item (character, number, or symbol) you want to select or text mark.
2. Press the text combination keys ALT+Z. The text is highlighted.

To-mark multiple items:
1. Use the arrow keys or other cursor movement keys to move the cursor to the
first character of the string (characters, numbers, or symbols) you want to
select.
A multiple text mark can span lines. Unlike the block mark, this type of a mark
is not a strictly rectangular shape. This type of mark wraps around lines.
Note: Blank lines between text lines are not marked.
2. Press the text combination keys ALT+Z.
3. After you mark one item (a character, number, or symbol), place the cursor on
the last item you want to mark and press the mark text keys ALT+Z. All text
from the beginning to the end is marked.
After you have marked text, you can revise the range of the mark by placing the
cursor at a different position and again pressing the combination key you last used.
If the cursor is outside the range of the marked area, the marked area will be
expanded to include the new position. If the cursor is within the marked area, it will
be conslrued as a new end of the area mark.

Unmarking Text
You can clear marked text from the E Editor window by pressing ALT+U. Any
marked text is no longer highlighted.

150

PC DOS User's Guide

Summary of Key Combinations for Marking and Unmarking Text
Following is a table which summarizes the key combinations you would use to mark
and unmark text.

ALT+B

Block mark for rectangles or lines.

ALT+L

Line mark for one or more lines.

ALT+W

Word mark.

ALT+Z

Text mark for sentences, phrases, or characters.

ALT+U

Unmark.

Using Key Combinations to Manipulate Text
You can perform any type of operation on the marked text that you want (such as
copy, move, delete, or reflow).

To manipulate an area of text:
1. Mark the text you wish to copy, move, delete, or reflow by pressing the key
combinations in the previous summary. The E Editor highlights the area to
show you what you have marked.
2. For copying or moving, select the destination for the highlighted text by moving
the cursor to the destination position.
3. Press a key combination, such as ALT+C (copy) to perform the operation.

Deleting Text
You use the DELETE command to delete a block of text and reposition the text
once the 'deletion is made.

To delete text:
1. Mark the text you want to delete.
Refer to "Marking Text Using Key Combinations" on page 149 for instructions
on how to select text if you do not know how to mark it.
2. Press ALT +D.
The text is deleted and the text to the right of the cursor shifts to the left to fill
the gap.

Chapter 10. Working with the Text Editor

151

Copying Text
You use the E Editor copy command to copy and reposition a block of text.
To copy a block of text:

1. Mark the block of text you want to copy.
Refer to "Marking Text Using Key Combinations" on page 149 for instructions
on how tb select text if you do not know how to mark it.
2. Select the destination for the highlighted text by moving the cursor to the
destination position.
3. Press ALT +C.
The block of text is copied to the new location, and it is not removed from its
original location.
To copy a block of text into another file:

1. Load the two files you are going to copy text between (target and

s~urce

files).

For information on how to edit more than one file at a time, see page 140.
2. In the file that has the text you want to copy, mark the block of text.
Refer to "Marking Text Using Key Combinations" on page 149 for instructions
on how to select text if you do not know how to mark it.
3. Select the destination for the highlighted text by switching to the second file
(F12 or CTRL+N). Then, move moving the cursor to the destination position.
4. Press ALT+C.
The block of text is copied to the new location, and it is not removed from its
original location.
You can copy the marked text into a file as many times as you want by repeating
the COpy command (ALT +C). The text remains marked until you change what is
marked.

152

PC DOS User's Guide

Moving Text
You can move a block of text. This procedure is useful if you want to rearrange the
order of text in a file.

To move a block of text within the same file:
1. Mark the block of text you want to move.
Refer to "Marking Text Using Key Combinations" on page 149 for instructions
on how to select text if you do not know how to mark it.
2. Move the cursor to the position where you want to move the text using the
arrow keys.
3. Press ALT+M.
The block of text is deleted from the original location and moved to the new
destination.

To move a block of text into another file:
1. Load the two files you are going to transfer text between (target and source
files).
For information on how to edit more than one file at a time, see page 140.
2. In the file that has the text you want to move, mark the block of text.
Refer to "Marking Text Using Key Combinations" on page 149 for instructions
on how to select text if you do not know how to mark it.
3. Select the destination for the highlighted text by switching to the second file
(CTRL+N or F12 on an enhanced keyboard) and moving the cursor to the
destination position.
.
4. Press ALT+M.
The block of text is moved to the new location, and it is removed from its
original location.
When you move a block of text, the text remains marked until you change what is
marked.

Chapter 10. Working with the Text Editor

153

Reflowing Text
The E Editor allows you to reflow text to fit with a new area between margin
settings or in an area you define.

Adjusting a Paragraph to the New Margins
The E Editor recognizes a blank line as the end of a paragraph. Therefore, you
can reflow text in a paragraph to adjust to new margin settings. Before you can
adjust a paragraph to new margins, you must first set the margins. See "Setting
Margins" on page 146 for more information.
If a paragraph is not followed by a blank line or an end-of-file indicator, you must
mark the paragraph before you can reflow text.
To reflow text to revised margin settings:

1. Move the cursor to the beginning of the paragraph.
2. If the paragraph is not terminated with a blank line or end-of-file indicator, mark
the area using combination keys.
The E Editor highlights the text you have marked.
3. Press ALT +P to adjust the marked paragraph to the current margin settings.

Reflowing Marked Text
Pressing the ALT +R combination keys lets you reflow a section of text to a defined
space. It is typically used to reformat a special paragraph (such as an indented
paragraph) without changing the margins.
To reflow marked text:

1. First mark the text to be reformatted (with any type of mark).
2. Press ALT +R.
You are prompted to mark the new block-the space into which you want the
block reflowed.
3. Move the cursor to the upper-left character of the block of text you want to
reflow and press ALT+B.
4. Move the cursor to the lower-right character of the block of text you want to
reflow and press ALT+B.
5. Press ALT+R and the text is reflowed. The space where the text came from is
filled with blank spaces.
ALT+P reflovis a marked paragraph to the new margin settings.

154

PC DOS User's Guide

In other words, with a block mark, ALT+P behaves as if you marked a block,
pressed ALT +R, and remarked the same block.

Summary of Text Operation Keys
After you have marked text, you can manipulate it by pressing the following key
combinations:

ALT+A

Copies text to a new location and fills the old position with blanks.

ALT+C

Copies the text to the new location by inserting it and pushing aside
existing text.

ALT+D

Deletes marked text. The space formerly occupied is discarded.

ALT+O

Copies text to a new location; overlays the existing text rather than
pushes it aside.

ALT+M

Moves marked text from one location to another location and discards
the space previously occupied by the text.

ALT+F

Fills an entire marked area with a character you specify. The
character can be a graphic; see "Entering Control and Graphic
Characters" on page 170 for information on how to enter a graphic
character. To end this operation, press ESC.

ALT+P

Reflows a marked paragraph to the new margin settings. If a block of
text is marked, reflows only the marked text to the new margin
settings. See "Adjusting a Paragraph to the New Margins" on
page 154 for details.
If the text is not marked, the paragraph following the cursor is
reformatted.

ALT+R

Reflows the marked text into a new defined area. See "Reflowing
Marked Text" on page 154 for details.

ALT+F7

Shifts marked text to the left. If you have text next to the left column
of the marked area, it will overlay any text in the far-left column of the
marked area.

ALT+FB

Shifts marked text to the right. All text to the right of the left edge
boundary is shifted right. The far-left marked column is filled with
blank spaces.

ALT+E

Moves the cursor to the end of the marked text. Except for
line-marked text, this is the far-right character of the last line. For
line-marked text, the curSor column is unchanged.

ALT+Y

Moves the cursor to the start of the marked text. Except for
line-marked text, this is the far-left character of the first line. For
line-marked text, the cursor column is unchanged.

Chapter 10. Working with the Text Editor

155

Some operation keys do not work with all combination keys, as shown in the
following table.
The top heading gives the marking keys. The left column shows the operation
keys. At the intersection of any row and column is a description of where the
cursor should be placed to define the destination. If no such description is given
(as at the intersection of ALT+L and ALT+A), the operation is not allowed.
Operation

ALT+L

ALT+B or ALT+W

ALT+Z

Top-Left Corner

Adjust (ALT+A)
Copy (ALT +C)

Line Above

Top-Left Corner

At Line

Delete (ALT+D)

Any Position

Any Position

Any Position

Top-Left Corner

Overlay (ALT+0)
Move (ALT+M)

Line Above

Top-Left Corner

Reflow. (ALT+P)

Any Position

Any Position

SHIFT (ALT+F7/F8)

Any Position

Any Position

Top-Left Corner
- Any Position

Using E Editor Commands
In addition to pressing keys or combinations of keys, you can use the E Editor
command line to perform many functions of the E Editor.
Enclosing an E Editor command in quotes when you invoke the E Editor lets you
specify a command that takes effect immediately upon loading the E Editor. You
can specify file names before the quoted command. For example, to start the
E Editor, open a file named REPORT.DOC, and move the cursor to the bottom of
the file, type the following at the DOS command prompt:

e report.doc 'bot'
Remember to press ESC to move from the window area of the E Editor to the
command line. Press ESC again to return to the window area of the E Editor.

156

PC DOS User's Guide

Finding Text
To find a word, a phrase, or a combination of characters in a file, use the / (search)
or L (locate) command. The text can be a word, a phrase, or any combination of
characters and spaces.
Note: To make sure the entire file is searched, go to the top of the file before you
begin your search.

You need to be specific about limiting your searches so you find only separate
occurrences, such as searching for "let" and finding these letters in the word
"letters." If you searched for "lett", you are limiting the search to a more specific
search pattern.
To find a word or phrase, use the following format:

/findword/ [options]
or

L/findword/ [options]
If you do not specify any options, the / (search) or L (locate) command will do the
following:
• Search the entire file (not only the marked area) in the forward direction.
\

For example, the search starts at the current line and proceeds toward the end
of the file.
• Search but ignore case.
For example, the E Editor finds both Brown and brown.
• Search left-to-right through lines.
Change the search options if you need to. When the E Editor searches for text, it
starts at the current cursor position and selects the first occurrence of the text. You
can specify the following search options:

+
m
a
c
e
r
f

Search from current line backwards to top of file (or if the m option is
chosen, to top of marked area). Search is left-to-right.
Search forward from current line to bottom of file.
Search within the marked text area only.
Search the current file, including the marked area.
Search but ignore case.
Search but match the search pattern's case exactly.
Search from right to left through lines.
Search from left-to-right through lines.

Chapter 10. Working with the Text Editor

157

To find text:
1. Return to the top of the file and type a / (search) or L (locate) command.
For example, if you want to find "help" as a separate word, you would type:

/help /
or

L/help /
Make sure you include the space after the word "help" because the E Editor
finds all occurrences, such as the help in helpless if you do not add the space
in your search pattern. The second / is normally not required if you do not
have options listed. Because you are limiting your search to help followed by a
space, the second / is required to add the space.
2. Press ENTER.
If no occurrences of the text are found, you see the Stri ng not found
message.
3. To search for the next occurrence of the specified text, press CTRL+F. Only the
file in the active editor window is searched.

or
4. To make a global search, press CTRL+G. All the files in the editor's ring are
searched.
The / (search) or L (locate) command leaves the cursor in the text area, not on the
E Editor command line.
The / (search) or L (locate) command continues to search through the file each time
you press CTRL+F until it reaches the end of the file.
Here is an example of the / (search) or L (locate) command:

/finalize/e
The E option means to search but match the case exactly. After you press ENTER,
the E Editor searches for the word "finalize", ignoring any words it might find that
have uppercase letters in it, such as "Finalize".

158

PC DOS User's Guide

Any search string delimiter (not only the slash I) can be used after the LOCATE
command. You need this if the search string itself contains a slash. When used
with the slash delimiters (I), the command does not require a blank between the C
and the /. However, if you are using a different delimiter, a blank space is required
between the L and the delimiter. The same is true of the C (change) command.
L

$/$

In the last example, '$' is the delimiter and 'I' is the string for which to search.
Multiple options can be given at one time.

/helper/-re
If contradictory options are given (such as
remembered.

Irf),

only the last option is the one

In this example, the E Editor searches for the word "helper" from the current line
backwards in the file, searches from right to left in the lines, and finds only the word
"helper" and matching capitalization exactly while it is searching.

Searching for Text Using the ALL Command
The ALL command creates a file called .ALL that shows all occurrences of a search
pattern you designated for the file you are in. The occurrences matching the
pattern are listed by line number. You can move from occurrence to occurrence by
pressing CTRL+Q combination.
To find a word or phrase, use the following format:

all /findword [lEe]]
The I can be any delimiter and e indicates to match case exactly.

To use the ALL command to search in a file:
1. Open up the file you want to search.
2. Type the following command if you want to find the word "expert" in the opened
files:

all /expert
3. Press ENTER.
If no occurrences of the word are found, you see the message:

String not found

Chapter 10. Working with the Text Editor

159

If the word is found:
• The .ALL file is created, showing the line number and contents of the line
where the word is found.
• You are placed in the .ALL file with the cursor blinking on the first
occurrence of the word.
4. Press CTRL+Q and you are switched from the .ALL file to the original file. The
cursor is placed on the first occurrence of the word in the original file.
Each time you press CTRL+Q, you are switched between the two files.
5. Save and quit out of your original file as usual. The .ALL file still appears on
your screen. You cannot save the .ALL file; however, you can rename it first
and then save it. When you quit a file, it disappears as though it never existed.

Searching for and Replacing Text
To find a word or phrase, use the following format: you can search for and replace
a set of characters in a file at the same time using the C (change) command. The
C (change) command begins at the cursor location and continues to the end of the
file. To make sure that you search for and replace the entire file, move the cursor
to the top of the file before you begin to search and replace text.
To find a word or phrase and replace it with other text, use the following format:
1. Type a C (change) command using the following format:

c/oldtext/newtext/ [options]
For example, if you are trying to find "mail" and replace it with "letters", you
would type:

c/mail /letters /
The "C" is the shortened form of the C (change) command.
Make sure you specify the spaces where necessary because the C (change)
command changes all occurrences. If the spaces were not specified in the
preceding example, the mail in mailbox would then become lettersbox if you do
not add the space in your search pattern.
One option is available with the C (change) command that is not available with
the L (locate) command. If you want to make all the changes, without being
prompted, add an asterisk (*) similar to the example that follows:

c/mispeled/misspelled/*

160

PC DOS User's Guide

If you do not specify options, the C (change) command will do the following:
• Change the entire file (not only the marked area) in the forward direction.
For example, the change starts at the current line and proceeds toward the
end of the file.
• Search but ignore case.
For example, the E Editor finds both Brown and brown.
• Search left-to-right through lines.
Change the options if you need to. The E Editor starts at the current cursor
position and changes the first occurrence of the text. You can specify the
following change options:

*
+

m
a
c
e

Makes all the changes, without being prompted.
Changes from current line backwards, to top of file (or if the m option is
chosen, to top of marked area). Search is from left-to-right.
Changes forward from current line to bottom of file.
Changes within the marked text area only.
Changes the current file, including the marked area.
Changes but ignores case. (This is the default for the CHANGE
command).
Changes but matches the search pattern's case exactly.
Searches from right to left through lines.
Searches from left-to-right through lines.

2. Press ENTER.
If the text is not found, the message Stri ng not found is displayed. If the text
is found, you see the message Yes/No/Last/Go/Qui t? near the bottom of the
screen.
3. Answer the question when the text is found by typing one of the following:
y

n
I
g

q

Makes the change for this one item and searches for the next
occurrence.
Skips the change and searches for the next occurrence.
Replaces this last one and then stop.
Goes ahead and replaces the remaining occurrences without prompting
for each occurrence.
Stops making any further changes and discontinues the search. You
can also press ESC.

Chapter 10. Working with the Text Editor

161

Then, from the E Editor command line, either:
Press CTRL+F

To find the next occurrence of the specified text.

or

Type C

To repeat the same C (change) command without having
to retype the C (change) command. You are immediately
asked Yes/No/Last/Go/Quit?

or

Press ESC

To put the cursor back in the text area.

The C (change) command leaves the cursor in the text area, not on the E Editor
command line.
The C (change) command continues to search through the file each time you press
CTRL+F until it reaches the end of the file.
Here are some examples of C (change) commands:
• In the following example, you are prompted to answer each time the word '''bills''
is found whether you want to make the change, not change this instance but
search for the next occurrence, replace this one and stop, or replace this one
and all the rest without prompting.

c /bills/invoices/
• Any search string delimiter (not only the slash!) can be used after the C
(change) command. You need this if the search string itself contains a slash.
When used with the slash delimiters (/), the C (change) command does not
require a blank between the C and the I. However, if you are using a different
delimiter, a blank space is required between the "C" and the delimiter. The
same is true of the L (locate) command.
For example, typing:

c $/$\$
changes the I to a \
• Multiple options can be given at one time, such as:

/helper/-re
If contradictory options are given (such as Irf), only the last option is the one
remembered.
In this example, the E Editor searches for the word "helper" from the current
line backwards in the file, searches from right to left in the lines, and finds only
the word "helper" and matching capitalization exactly while it is searching.

162

PC DOS User's Guide

Drawing Lines
You can use graphics characters to draw boxes and diagrams. The DRAW
command can be typed at the E Editor command line:

draw
You can also press F6.
To select drawing mode, you must issue the DRAW command with one of these
arguments:
Draw Option

Result

Draws a thin, single line

2

Draws a thin, double line

3

Draws a dotted line

4

Draws a thick line

5

Draws a double, thin line horizontally; single, thin line vertically

6

Draws a double, thin line vertically; draws a single, thin line
horizontally.

/character

Uses any character that follows the slash (I) to form a box.

Note: Draw options 5 and 6 apply only if you are using code page 437.

If you type the DRAW command without any arguments, the visual
representations: 1, 2, 3, 4, 5, 6, B, or / any char appear at the bottom of the
screen as a reminder. For example:

draw 2
You are now in draw mode, which means that the cursor acts like a paint brush:
everywhere you move the cursor, a double line (because you typed 2) is drawn.
Draw any shape with the cursor using the arrow keys (LEFT, RIGHT, UP, and
DOWN). While in the drawing mode, you can stop drawing the double line and type
in text or move the cursor to another location without drawing anything (in other
words, lift the paint brush) by pressing the INSERTkey. This key suspends the
drawing without exiting from draw mode.
To begin drawing again, simply press the INSERT key again. Pressing any key
besides those on the numeric key pad ends draw mode.

Chapter 10. Working with the Text Editor

163

You can draw figures with characters other than the line graphics characters
provided. For example, if you want to draw figures composed of the left
parentheses, you would type at the E Editor command line:
\

draw I(
This process works with any character on the keyboard, as long as you precede the
character with a slash (I).

Creating Boxes Around Text
You can use graphics characters to draw boxes. The BOX command can be typed
at the E Editor command line:

box
To create a box, you must issue the BOX command at the E Editor command line
with one of these arguments:
Box Option

Result

A

Creates a box comment using Assembler syntax.

.8

Places spaces on all sides of the marked area, creating a box of
blank spaces.

C

Creates a box comment using C language syntax.

E

Erases the box around the marked area.

P

Creates a box comment using Pascal language syntax.

R

Reflows text in the marked area.

S

Places a SCRIPT comment box around the marked area.

If you type the BOX command without any arguments, the visual representations
for: 1, 2, 3, 4, 5, 6, B, lx, P, C, A, E, R, and S appear at the bottom of the
screen as a reminder.
For example, for a double line, you could type:

box 2

Combining Files
Three E Editor commands can be used to pull text from one file and place it into a
different file: GET, PUT, and APPEND.
The E Editor allows you to have multiple files open at one time. You can mark text
in one file and insert that text into another file you have open.

164

PC DOS User's Guide

For example, you just finished a note summarizing your monthly activities in which
you listed some statistics you want to put in a second file. You do not want to
insert the entire note; you want only the statistical information pulled into a second
file.

To use the GET command to insert another file into an opened file:
1. Open the file you want to pull information into.
For example, open a file named NEWFILE.TXT by typing the following:

e c:\newfile.txt
2. Place the cursor at the top of the file because this is a new file without any
current information in it.
Normally you would place the cursor on an existing line, just above where you
want to insert the file. Then use the GET command and the information from
the other file will be pulled in following the line where the cursor is.
3. Press ESC to get to the E Editor command line.
4. Type the GET command using the following format:

get fi lespec
Substitute the full path and file name of the file you want to insert. For
example, to pull the entire C:\REPORTS.TXT file into the C:\NEWFILE.TXT file,
type the following at the E Editor command line:

get c:\reports.txt
5. Press ENTER.
The entire file is pulled into the NEWFILE.TXT file, following the line where the
cursor is placed.

To use the PUT command to insert a file or part of the file into another file:
1. Open a file that contains information you want to put into another file.
For example, open a file named NEWFILE.TXT by typing the following:

e c:\newfile.txt
2. Mark the text you want to put into another file by using the line-mark keys
combination ALT +L. If you do not mark any text, the entire file will be inserted.
3. Press ESC to get to the E Editor command line.
4. Type the PUT command using the following format:

put filespec

Chapter 10. Working with the Text Editor

165

SUbstitute the full path and file name of the file you want to insert the marked
text into. The file can be a file that already exists or a new file.
For example, to pull the marked text from the file C:\NEWFILE.TXT into the
C:\REPORTS.TXT file, type the following at the E Editor command line:

put c:\reports.txt
and press· ENTER.
The marked text or the complete opened file (NEWFILE.TXT) is always written
to the file specified in the PUT command (REPORTS.TXT).
Only the marked text is inserted into the REPORTS.TXT file. If the file already
exists, the information can be placed only at the bottom of the file; the file is not
overwritten.
If you use the PUT command to insert an entire file, you do not have to open or
mark the text first.
For convenience, filespec can be omitted if you want to repeat a PUT to the same
file. PUT commands without a filespec reuse the last-specified name.
If you do not move the cursor and do another PUT command, the text from the
second PUT command is inserted immediately following the text inserted from the
first PUT command.

To print using the PUT command:
You can print a marked block of text by issuing PUT prn at the E Editor command
line. The readiness of the printer is tested first to avoid having to wait for a device
time-out in case the printer is offline. The PRINT command allows you to print only
marked text.
If no text is marked, the entire current file will be printed.

To append text to the bottom of a file:
The APPEND command works the same way the PUT command works, appending
the text to the bottom of a file.

To use the equal sign to repeat the file name:
You can use the equal sign (=) as a shorthand for either the current file's directory
or file name. Remember that the equal sign is shorthand for "same path as last
specified" at the DOS command prompt, or "same path as current file's" at the
E Editor command line.

166

PC DOS User's Guide

For example, you are currently editing a file named REPORT1.TXT located in the
C:\REPORTS subdirectory. You want to edit REPORT2 in the same subdirectory.
At the E Editor command line, type:

e =report2.txt
The file's path and file name can be seen as
bottom left-hand part of the screen.

c: REPORTS\REPORT2. TXT near the

Adding and Multiplying Numbers
If you need to add columns or rows of numbers, the E Editor provides both an ADD
and a MULTIPLY command. See "Calculating Mathematical Expressions" for the
proper format.
To add or multiply a column or row of numbers:
1. Mark the text you wish to add or multiply.
You can do this by pressing ALT +B once at the top left-hand corner of the
column and again at the bottom right-hand corner of the column of numbers.
When you finish marking the end of the text, the text is highlighted to show you
the column of text you have marked.
2. Press ESC to get to the E command line at the bottom of your screen.
3. Type add or type mul t depending on the type of operation you want to perform.
4. Press ENTER.
To return the cursor to the text area, press ESC.

Calculating Mathematical Expressions
If you need to add, subtract, multiply, or divide hex, octeil, binary, or decimal
numbers, the E Editor provides a set of MATH commands that compute an
arithmetic expression of the following format:

arithmetic expression: arith term arith operator arith term
arith term: decimal number
I binary number
I hex number
I octal number
I 1(1
arithmetic expression
arith operator:

I
I
I

1)1

1+1
1- 1

1*1
1/1

Chapter 10. Working with the Text Editor

167

Binary (base 2) numbers must be preceded by the letter "b". Hexadecimal (base
16) numbers must be preceded by the letter "x", (for example, x10 = 16). Octal
(base 8) numbers must be preceded by the letter "0" (for example, 012 = 10).
Math Command

What It Does

math arithmetic expression

The MATH command computes the expression and
appends the result as a decimal number.

mathx arithmetic expression

The MATHX command computes the expression and
appends the result as a hexadecimal number.

matho arithmetic expression

The MATHO command computes the expression and
appends the result as an octal number.

mathb arithmetic expression

The MATHB command computes the expression and
appends the result as a binary number.

Try some of the following MATH commands. If your cursor is not on the highlighted
E Editor command line, press ESC.

math
mathx
mathb
matho
math

-10 + 40
-xff + 10
b10 + b01
011 * (xff ,- 10)
32000 + 32000

The above examples would yield 30, xFFOB, b11, 04235, and 64000, respectively.
All numbers, answers, and intermediate results are limited to the range
-2,147,483,648 to 2,147,483,647 for octal, hexadecimal, and binary.

Notes:
1. For decimal numbers the range is 19 significant digits. For example, you could
have the number 1 (and eighteen zeros). Of course, the zeros would not be
displayed in an actual calculation.
2. Use the PC DOS ACALC command from the E Editor command line for many
more functions. Type help aca 1c for more information about the ACALC
command.

Summary of E Editor Commands
A summary of the E Editor commands and the tasks that can be performed by
them from the E Editor command line is provided in the online PC DOS 7
Command Reference. This summary can be found in the information about the
E Editor by typing help e at the DOS command prompt.

168

PC DOS User's Guide

Customizing the E Editor
Ways you can customize the E Editor include:
• Changing the way the window appears, such as to a non-overlapping (tiled)
window or an overlapping (messy) window.
• Entering control and graphic characters
• Using syntax-directed editing features

Changing to a Non-Overlapping (Tiled) Window
The E Editor provides two styles of windowing. In the tiled (non-overlapping)
window style, which is how the E Editor window normally appears, the windows do
not overlap. This allows changes to your file to be shown immediately in
neighboring views of the same file.
You can see this with a quick experiment: Press CTRL+H to split the screen into
two horizontal views of the same file and type.
Tiled windows cannot be resized or moved around the screen because this might
cause one window to overlap another. Tiled windowing also has the interesting
. characteristic that each window or tile contains the same ring of files as the other
tiles or windows. Simply press CTRL+W when you are in the text area to alternate
between the tiles. Each tile keeps track of its own cursor position so that you can
edit two places in the same file without having to page up or page down.

Changing to an Overlapping (Messy) Window
In messy (overlapping) desktop, the windows can overlap. You use the SIZE and
DRAG commands to select the window's size and position.
To acquire a messy window mode, edit the E.INI file. Refer to information about
the E.INI file in th~ online PC DOS 7 Command Reference for more information.

Chapter 10. Working with the Text Editor

169

Keys or Command

How it customizes the window

CTRL+A

Selects next tiled window configuration. There are four
different window arrangements you can use if you have
specified tiled windows. You can view all four window
configurations by continuing to press CTRL+A to view each
window configuration.
Note: CTRL+A can be used only in tiled windows.
One window zoomed to fill the screen.
Two equal windows positioned vertically.
Four windows divided into four equally sized windows.
Two equal windows positioned horizontally.

CTRL+H

Selects two horizontal, window-tile configuration.

CTRL+N

Switches to next file when you have multiple files open.

CTRL+P

Switches to previous file when you have multiple files open.

CTRL+V

Selects two vertical, window-tile configuration.

CTRL+W

Switches to next window.

CTRL+Z

Switches to one fully-zoomed, window-tile configuration. In
the messy desktop configuration, this expands the current
window to full screen.

F10

Jumps to the E Editor menu. Then the arrow keys can be
used to highlight menu selections and access the menu for
each choice.

F11

Switches to previous file when you have multiple files open.

F12

Switches to next file when you have multiple files open.

SIZE command

Resizes a window. It is used only for the messy desktop
window configuration.

DRAG command

Moves a window. It is used only for the messy desktop
window configuration.

Entering Control and Graphic Characters
You can enter PC graphic characters (those with extended ASCII codes greater
than 127) with ALT+keypad numbers.
For example, to enter the symbol for the Greek character pi (represented by the
code 227):
1. Press ALT and continue holding the key down.
2. Type 227 on the numeric keypad.
3. Release ALT.

170

PC DOS User's Guide

Graphic symbols with codes less than 32 might be harder to enter because they
conflict with control characters recognized by the E Editor. You might want to enter
the character with code 12 because you like the looks of the graphic symbol or
because you wish to send that control code to a printer. Code 12 is the same as
CTRL+L, which is recognized as formfeeding by printers. You cannot type it simply
by pressing CTRL+L because a CTRL+L is recognized by the E Editor as a special
action (copy the current line of text to the command line).
In such a case, you can force the E Editor to accept the code without evaluation by
prefacing it with ALT+X. Press ALT+X first, followed by CTRL+L and then press
ENTER.

Note: ALT+X is only necessary if the key has already been defined. But pressing
ALT+X is always safe. If you are unsure whether the key is predefined,
press ALT+X first.
You can also follow ALT+X with an extended key such as F1, but this is seldom
useful. Extended keys are represented on the computer by two characters, a null
(ASCII zero, which looks like a blank) with another character. For instance, F1
gives you a null with a semicolon .
. The E Editor cannot handle the following graphic characters, as they have special
control meanings:
Tab
Li ne Feed

Carriage Return
End of Fil e

x ' 09 1
x ' 0A '
x ' 0D '
x 'IA I (only foll owi ng a CR/LF)

Using Syntax-Directed Editing Features
The E Editor has an optional syntax-directed editing feature for REXX and C
language files. The feature is defaulted to ON. You can modify the option from the
E Editor command line or by editing the E.INI file.
If you modify the feature by editing the E.INI file, you can specify a new default
value. Modifying the feature from the E Editor command line only provides a
temporary override of the default values .
.You can also modify the syntax-directed editing indentation. The indentation
feature allows you to customize both REXX and C language file indentation,
independently. These features may be modified only by editing the E.INI file.
Syntax-directed editing is provided when a language-specific keyword is combined
with a special key. For example, in REXX the language keyword IF is followed by
the special key, SPACEBAR.
Chapter 10. Working with the Text Editor

171

A REXX language file is identified when" /*" are the first two characters of a file
having the extension .BAT or .CMD. A C-Ianguage file is identified by a .C, .CPP,
;H, or .HPP extension.
Typical syntax-directed editing features can be demonstrated by the following
sequence.

To try an example of syntax-directory editing:
1. Type e newfile.c
This example uses the file name of NEWFILE.C. Remember that the file's
extension must be .C or .BAT for· syntax-directed editing to work.
Note: For REXX expansion to work when you have a .BAT file, the first line
must have a comment that begins with /*.

2. Type rna in and press the SPACEBAR.
3. Enter the main statement.
4. Type if and press the SPACEBAR.
This sequence edits a new file called NEWFILE.C. Pressing the SPACEBAR in both
instances above inserts the remainder of the MAIN and IF structures.
When automatic syntax expansion is OFF, you can force expansion to occur by
pressing CTRL+X.
Box comments can also be created easily, according to the syntax particular to the
language.
More information about using the syntax-directed editing features is provided in the
online PC DOS 7 Command Reference. This information can be found by typing
he 1peat the DOS command prompt.

Comparing a Text Editor and a Word Processing Program
A text editor, sometimes referred to as an editing tool, differs from a word
processing program in the following ways:
• Files you create by using the text editor are unformatted text files, such as
ASCII text files, which means they do not contain any special formatting
characters. If you save such a file when using a text editor, the special
characters of the word processing program may lose their formatting function.
Because DOS batch programs and files, such as AUTOEXEC.BAT and
CONFIG.SYS, must be unformatted text files, text editors are a useful tool for
customizing your system ..

172

PC DOS User's Guide

• When you reach the end of a line using a text editor, you must press ENTER to
move the cursor to the next line because there is no "word wrap" feature
associated with a text editor. A line of text can be up to 255 characters long.
Note: There are things you can do to overcome this problem and others
associated with most text editors by using the flexibility built into the
E Editor. For instance, you can set margins or you can use the default
margins of the E Editor which are 1 and 254. When your line of text
reaches 254 it automatically wraps to the next line. This chapter helps
you take advantage of this type of E Editor flexibility.

• Unlike word processing programs that always place files in a specific directory,
you must specify the exact location (full path) where you want to place the file
when using a text editor.
• A text editor can have its own command line within the program. This
command line is not the same command line as the DOS command prompt.
Other editors' command lines allow you to type editor commands used only for
performing tasks within the text editor. However, the E Editor also allows you
to type DOS commands at the E Editor command line.
Although not designed to be a word processor, the flexibility of the E Editor allows
it to be modified to make it "act" more like a word processing program, such as:
• Set the margins before you start typing (for example, type margi ns 10 70). The
text then "word wraps" when it reaches the right margin you have set. Setting
margins eliminates your having to press ENTER at the end of each line of text;
press ENTER only to start a new paragraph.
• Use the Autosave feature to automatically get temporary backup versions of
your files.
• Make menu selection~ using a mouse for performing editing tasks. You can
select items from the menu by doing one of the following:
- Using the mouse to click on a selection
- Pressing F10
- Pressing ALT
• You can load up to 35 files into the E Editor and toggle back and forth to work
on them as though these files were in a ring.

Chapter 10. Working with the Text Editor

173

174

PC DOS User's Guide

Chapter 11. Connecting Computers
Using the InterLnk utility programs (INTERLNK.EXE and INTERSVR.EXE) and a
cable, you can easily connect one computer to another computer to:
• Transfer files between computers.
• Use one computer to run programs located on another computer.
• Access information without having to copy files from one computer to another
using diskettes.
Assume you regularly gather information in the field using your laptop computer to
record the information. When you return to the home office, you need to transfer
the information to a database on your desktop computer. Using the InterLnk
program, you can directly add the information you have gathered to the database
on your desktop computer and print out the new information without copying files to
and from diskettes.

Laptop
(Client)

Laptop
Drives

Desktop
Drives

A
C

D

E equals A
F equals B
G equals C

© Copyright IBM Corp. 1981, 1995

175

Establishing the Connection between Computers
The following hardware, software, and available memory requirements must be met
before you can use INTERLNK:
• Two computers running DOS Version 5.02 or higher. Running this version of
DOS ensures that both the INTERLNK.EXE and INTERSVR.EXE files are
available.
If you do not have DOS Version 5.02 or higher on one of the computers, refer
to "Remote Copying of INTERSVR.EXE and INTERLNK.EXE Files" on
page 183.
You can also have a configuration that consists of a computer running OS/2 2.1
or greater and a computer running· DOS Version 5.02 or greater. The computer
running OS/2 must be designated as the client and can only run INTERLNK.
The computer running DOS must be designated as the server and can only run
INTERSVR. See "Using INTERLNK on OS/2" on page 185 for more
information.
• An available serial or parallel port on each computer. Your cable connection
must be serial-to-serial,or parallel-to-parallel; if you have an available serial
port, the second computer must also have an available serial port.
CAUTION:

Plugging a parallel cable into a serial connector or vice versa will damage
your'computer system.
• A type of connecting serial or parallel cable, such as:
- A 3-wire, serial cable

- A bidirectional parallel cable
- .A 7-wire, null-modem, serial cable (only used for the remote installation)
Refer to "Reviewing Cable Specifications" on page 184 for specific details
on how to wire the pin connections for serial and parallel cables. The
file-transfer utility programs support serial links using a null-modem cable,
and serial and parallel links that use cables provided with FastLynx**,
LapLink**, .and Brooklyn Bridge** products.

** FastLynx is a trademark of the Rupp Corporation.
** LapLink is a trademark of Traveling Software, Inc.
** Brooklyn Bridge is a trademark of Fifth Generation Systems, Inc.

176

PC DOS User's Guide

• 16K of free memory on the client computer and 130K of free memory on the
server computer.
• The INTERLNK.EXE device driver statement in your CONFIG.SYS file on the
designated client computer. Instructions on how to add this statement are
given later in this chapter.

Understanding What the InterLnk Program Does
InterLnk is specifically designed to let you exchange files between any two types of
computers (for example, laptop to desktop or desktop to desktop) that can be
connected by cables. InterLnk consists of two, separate file-transfer utility
programs:
• INTERLNK.EXE
• INTERSVR.EXE

Client and Server Relationship
Before you begin using these two programs, INTERLNK and INTERSVR, you need
.to understand the client and server relationship.
Client

The computer you use to enter commands is called the client.
After a connection is made to the server computer, the client
computer presumes that the server computer's drives and printers
are its own, giving it accessibility to additional information, files,
and printers.
The client runs the INTERLNK.EXE program.

Server

The computer connected to the client is the server, which is
dedicated to serving the client. The server computer runs the
file-transfer program.
The server runs the INTERSVR.EXE program. '

Using the InterLnk program, you can create a client/server relationship between two
computers.
Once a connection is made to the server computer, you can do the same things
with the server computer's drives and printers that you can do with your own
computer, the client. If you connect a laptop to a desktop computer, the laptop is
generally the client.
After you connect your computers and start the InterLnk program, you can use a
laptop or other computer (as the client) to access data on both it and your desktop
computer. The screen of the desktop computer (the server) displays the status of

Chapter 11. Connecting Computers

177

the connection. You use the desktop computer keyboard only to break the
connection between the two computers.
Suppose the laptop computer has three drives: a diskette drive (A) and two hard
disk drives (C and D). The desktop computer also has three drives: two diskette
drives (A and 8) and a hard disk drive (C), similar to the following:
Laptop Drives

Desktop Drives

A
C
D

A

B
C

With the InterLnk program connecting the two computers, drives on the desktop
computer (the server) appear as additional drives on the laptop computer (the
client). In addition to drives A, C, and D, the laptop computer now includes drives
E, F, and G. which have been redirected from the desktop computer.
For example, if you typed the following command on the laptop computer, you see
displayed a list of files located in the root directory of a diskette inserted into drive A
of the desktop computer:

dir e:\
A list similar to the illustration is displayed on your computer's screen:

This Computer
(Client)
E:
equals
F:
equals
G:
equals

Other Computer
(Server)

A:
B:
C:

This list displays how the drives were redirected. You see E equals Adisplayed.
liE equals A" means that drive E of the client (laptop) is redirected to drive A of the
server (desktop).
The server's drives A, 8, and C are now presumed to be the client's drives E, F,
and G. If you make drive E your current drive on the laptop computer, any
commands you type on the laptop are carried out on the drive A of the desktop
computer.
Note that the InterLnk program assigns the drive letters, starting after the last drive
letter, and does not fill in any missing drive letters such as the missing drive 8, as·
is the case with most laptop computers.

178

PC DOS User's Guide

Client Device Driver (INTERLNK.EXE)
INTERLNK is a single device driver performing either serial or parallel
communication. This program redirects server drives and printers, meaning that the
drives and printers from both computers can be controlled from one computer
keyboard.
When you connect your computers and start INTERLNK and INTERSVR on the
server, the server displays the way your drives are mapped. You can change
which drives and printers have access by redirecting or remapping the server drives
to the client drives. You can access only six drives at one time. If the drive or
printer you need to access is not one of the six currently listed, you will need to
redirect the drives or printers so the drive or printer is one of the six.
INTERLNK does not require any special switches or parameters for most
configurations. Serial and parallel communications support and printer support are
installed by default. Hardware ports and interrupt levels are set up automatically.
INTERLNK loads itself into upper memory when upper memory blocks are available
from DOS, unless you have set up the RAM Boost program to optimize your upper
memory blocks.
For more information about INTERLNK or INTERLNK.EXE, see your online
PC DOS 7 Command Reference. Or, type either hel p interl nk or hel p
interlnk.exe at the DOS command pro,mpt.

INTERLNK Server Program (INTERSVR.EXE)
INTERSVR is a dedicated, full-screen program, used for communicating with the
client computer through serial and parallel lines. The server allows use of local
drives and attached printers by the client computer.
The server program provides an interactive user interface and a command line
option to do the following:
• Exclude certain drives from the server.
Refer to "Excluding Drives from Redirection" on page 183.
• Sequence the offering of drives.
For example, if you have five drives (A through E, of which A and B are empty
diskette drives on the server computer) and the client has only three drives
available, the normal sequencing would map or·assign the letters A, B, and C.

Chapter 11. Connecting Computers

179

To ignore drives A and B, you can type the following on the server to sequence
t.he drives:
.

intersvr c: d: e:
While the server does not require any interaction after it is started, it provides the
following types of feedback:
•
•
•
•
•

Current state of drive mappings and printer redirection
Drives that are offered
Current baud rate (speed of data transmission)
Drive activity
Port you are connected to (a COM port means DOS searches only for serial
ports; an LPT port means DOS searches only for parallel ports)

Note: Network drives cannot be redirected by this program.
For a list of the options available with INTERSVR, type hel p i ntersvr at the DOS
command prompt.

Including INTERLNK in Your CONFIG.SYS File
On the client computer, use a text editor, such as the E Editor provided with DOS,
and add the following device driver statement to your CONFIG.SYS file:

device=c:\dos\interlnk.exe
By default, you are allowed to redirect three drives from the server. To redirect
more than three, you must add the /drive switch to specify a number other than
three or to specify no drives at all if you want to redirect only printers. For example,
if you wanted to redirect four drives, type:

device=c:\dos\interlnk.exe /drives:4
If you are using a RAM drive, place the DEVICE=INTERLNK.EXE statement after
the DEVICE=RAMDRIVE.SYS line to prevent INTERLNK from redirecting these
drives first.
After you have added the device driver statement in your CONFIG.SYS file, restart
the client computer by pressing CTRL+ALT +DEL. Restarting the client computer
loads INTERLNK.

180

PC DOS User's Guide

Running the InterLnk Program
Before you start the InterLnk program, make sure you have physically connected
your computers by attaching the appropriate cables to the ports, either
serial-to-serial or parallel-to-parallel.
To start the InterLnk program:

1. On the server computer, type the following at the DOS command prompt for a
serial connection:

intersvr
Or, type the following on the server computer at the DOS command prompt for
a parallel connection:

intersvr /lptl:
You see a screen displaying the server drives similar to the following:

This Computer
(Server)

A:
B:
C:
D:
LPTl:

Other Computer.
(Client)
equals
equals
equals
equals
equals

D:
E:

F:
G:
LPT2:

If you are running Windows, you will see a task-swapping message; if you are
running DOS, you will not see this message. Press ENTER to continue or press
F3 to quit.

2. On the client computer, make sure you have added the device driver statement
in your CONFIG.SYSfile (see "Including INTERLNK in Your CONFIG.SYS File"
on page 180).
INTERLNK attempts to load this program into upper memory blocks if they are
available; if they are not available, it loads into conventional memory. By
default, INTERLNK remains in memory whether it finds another computer to
connect with unless you specify the /noscan switch.
3. Verify that the InterLnk program is loaded and view the status of the
connections by typing the following at the DOS command prompt of the client
computer:

interlnk

Chapter 11. Connecting Computers

181

You see a screen displaying the drives that are connected similar to the following:

This Computer
(Client)

Other Computer
(Server)

======================================

D:
E:
F:
G:
LPT2:

equals
equals
equals
equals
equals

A:
B:
C:
D:
LPT1:

You are now able to access the drives of the server computer as though they were
located on your client computer. If you need different drives than the ones currently
accessed, redirect the drives.
When you are finished, press ALT+F4 on the server. The server returns to the DOS
command prompt and the client no longer has access to the server's drives.

Redirecting Drives
If a device was assigned when you started INTERLNK, you can redirect the device
on the client by using the INTERLNK command and specifying the server drive you
want to redirect it to. Suppose that client drive 0 is redirected to server drive A,
and the other drives are redirected as in the ,following example:

This Computer
(Client)
D:
E:
F:
LPT2:

equals
equals
equal s
equals

Other Computer
(Server)

A:
B:
C:
LPT1:

To redirect client drive 0 to server drive C, type the following at the client
workstation:

interlnk d=c
To cancel the redirection of client drive 0, do not specify a server drive, as follows:

interlnk d=

182

PC DOS User's Guide

Excluding Drives from Redirection
On the server computer, if you want to exclude a drive from redirection and make it
unavailable to the client system, add the Ix switch followed by the letter of the drive
you want to exclude, such as:

intersvr /x:d

Breaking the Connection between Computers
To break the INTERLNK connection between computers and stop the server, press
ALT+F4 on the keyboard of the server computer.

To restart the server, type:

intersvr

Remote Copying of INTERSVR.EXE and INTERLNK.EXE Files
If, for some reason, you do not have DOS Version 5.02 or later installed on one of
your computers, you will need to copy the INTERLNK.EXE and INTERSVR.EXE
program files to the computer that does not have these files before you can run the
InterLnk program. Although you need only the INTERLNK.EXE file for the client
computer and the INTERSVR.EXE for the server computer, both files can reside on
each computer.
To copy files remotely:
1. If the server computer is connected to the client computer by a 7-wire
null-modem serial cable, type the following at the server computer command
prompt:

intersvr /rcopy
The INTERLNK Remote Installation screen is displayed.
2. Specify the serial port of the other computer by using the direction arrows until
you highlight the COM (serial) port you will use and press ENTER.
3. Type on the client computer the MODE command you see displayed on the
server computer. For example, you might type something similar to:

mode coml:2400,n,8,1,p
which specifies a configuration for the serial port you have selected of 2400
baud, no parity, 8 bits, and 1 stop bit. The p parameter tells the program to
keep trying to configure the port until a confirmation message is received that it
has been reconfigured.
4. Press ENTER.
Chapter 11. Connecting Computers

183

5. Instruct DOS to accept the input from the COM1 port by typing:

ctty coml
The program is uploaded and sends a program which then receives the
INTERSVR.EXE and the INTERLNKEXE files automatically.
Also, you can copy the INTERSVR.EXE and INTERLNKEXE files to a diskette and
then copy the files to the other computer, placing the files in the \OOS directory.

Reviewing Cable Specifications

a

The file-transfer utility programs support serial links using null-modem cable, such
as LapLink or FastLynx cable. These programs interact directly with the serial port
hardware instead of the computer's BIOS to make the connection. In most cases,
for these programs the connecting cable is a serial cable. However, if the parallel
ports on both systems are bidirectional, you will be able to use a parallel cable.
You can create your own serial or parallel cable using the wiring tables below.
If you want to use a serial port to transfer your data, then you must use the
null-modem cable. Connect the null-modem cable to the serial port on your
computer.
To use the file-transfer utility programs, you need the following:
• Two computers with DOS 5.02 or higher installed on each computer.
If you do not have DOS Version 5.02 or higher on one of the computers, refer
to "Remote Copying of INTERSVR.EXE and INTERLNKEXE Files" on
page 183.
• A null-modem cable to connect to the serial ports of your computers or a
parallel cable to connect to the parallel ports of your computers.

Serial Cable
There are two kinds of physical RS-232 ports used by 00S-9 pin (OB9) and
25-pin(OB25). Use the following table to wire the pin connections for a serial cable.
9 Pin
pin 5
pin 3
pin 7
pin 6
pin 2
pin 8
pin 4

184

25 Pin
pin 7
pin 2
pin 4
pin 6
pin 3
pin 5
pin 20

PC DOS User's Guide

<-------->
<-------->
<-------->
<-------->
<-------->
<-------->
<-------->

25 Pin
pin 7
pin 3
pin 5
pin 20
pin 2
pin 4
pin 6

9 Pin
pin 5
pin 2
pin 8
pin 4
pin 3
pin 7
pin 6

Ground-Ground
Transmit-Receive
RTS-CTS
DSR-DTR
Receive-Transmit
CTS-RTS
DTR-DSR

Note: The ground wire is connected to the same pin on both ends. The last three
wires are the reverse of the prior three.

Parallel Cable
Use the following table to wire the pin connections for a parallel cable.
25 Pin
pin 2
pin 3
pin 4
pin 5
pin 6
pin 15
pin 13
pin 12
pin 10
pin 11
pin 25

<-------->
<-------->
<-------->
<-------->
<-------->
<_____ l. __ >
<-------->
<-------->
<-------->
<-------->
<-------->

25 Pin
pin 15
pin 13
pin 12
pin 10
pin 11
pin 2
pin 3
pin 4
pin 5
pin 6
pin 25

Note: Pin 25 to pin 25 is the ground-to-ground connection for this cable-wiring
table.

Using INTERLNK on OS/2
INTERLNK can be run only on OS/2 2.1 or OS/2 WARP V3.0 as a client.
To set up the Interlnk environment on OS/2:
1. Insert a blank diskette into drive A of the computer running DOS.
2. At the DOS command prompt, type the following command to format the
diskette:

format

a: /s

3. Use a text editor to create a CONFIG.SYS file on the diskette in drive A. The
CONFIG.SYS file on the diskette should contain the following lines:

DEVICE=FSFILTER.SYS
DEVICE=INTERLNK.EXE
You might need to include additional parameters with INTERLNK.EXE. Type
hel p i nterl nk. exe for more information.

Chapter 11. Connecting Computers

185

4. Copy the INTERLNK.EXE file from your DOS subdirectory to the same diskette
already inserted into drive A.
5. Take the diskette from the computer running D9S, and insert it into drive A of
the computer running OS/2.
6. Copy the FSFILTER.SYS file from the \OS2\MDOS subdirectory of your boot
drive (generally drive C:) to the diskette in drive A.
7. At the OS/2 command prompt, type the following command to create a DOS
image file:

vmdi sk a: c: \pcdos. img
The name of the file must have the extension IMG (such as the example
PCDOS.IMG). The PCDOS.IMG file can be located on any drive.
The following scenario is a representation only. Your desktop may not be set up
exactly as is described here. However, you can use the steps presented as a
guide to what needs to be done to create a PC DOS icon by copying another icon
and linking it to a DOS sessions program.

To create a PC DOS image file:
1. From your OS/2 desktop, double-click on the OS/2 System icon.
2. Double-click on the Command Prompts icon.
3. Use mouse button 2 (right mouse button) and click on the DOS Window icon.
4. Click on Copy.
5. On the notebook page, enter the name you want for the icon's new name (for
example, PC DOS).
6. Click on Copy.
7. Click on OK to create the icon.
8. On the OS/2 desktop, click on the new PC DOS icon. you just created.

9. Click on the arrow to the right of Open.
10. Click on Settings.
11. While on the notebook page, click on the Session tab.
12. Click on the DOS Settings push button.

186

PC DOS User's Guide

13. While in the notebook page for Settings: click on COM_DIRECT_ACCESS and then
select On for the value.
14. Then click on DOS_STARTUP_DRIVE, enter an image name and path in the Value
field. and then click on the Save button.
Note: Enter the same path where you placed the PCDOS.IMG file earlier in
this procedure.
15. Close the Settings notebook page by double-clicking on the title bar icon in the
top-left corner.
16. Close all windows that are still open on the OS/2 desktop.
17. Go to the computer running PC DOS and start the server by typing the
following at the DOS command prompt:

intersvr
18. Double-click on the PC DOS icon to get your DOS session.
The server and the client are now connected.

Chapter 11. Connecting Computers

187

188

PC DOS User's Guide

Chapter 12. Using File Update
Use the File Update Utility to maintain files on two different systems and keep them
synchronized. The two systems can be two separate PCs, a PC and a local area
network (LAN), or two different locations on the same PC. This is useful if you
work with the same files on separate systems (for example, when you use a laptop
on the road or take work home from the office). You can also use File Update to
keep backup files of your work on another drive or partition.
This chapter describes how to install File Update on two systems (referred to as
base and remote locations). It shows you how to set up your system and explains
how to keep files in "sync" when you transfer them from one location to another.
Before you install File Update, however, it is a good idea to make sure the time and
date at both locations are the same. You must also know how files and directories
are organized on both your systems. File Update tracks any changes that are
made to the files and directories you specify.
Ask yourself:
• What are the names and extensions of the files you want tracked?
For example, all files with a .TXT extension, such as REPORT.TXT.
• In what directories are these files located?
For example, C:\COMPUTER\SALES at the base location and D:\SALES at the
remote location.
You can use the TREE command to answer these questions. TREE displays the
directory paths and files on your drives so that you know where things are. For
example, if you want to list all directories and files on drive C and save the list in a
file named TREE.OUT, type the following at the DOS command prompt:

tree c:/f >tree.out
You could also redirect the output to your printer by typing:

tree c:/f >prn

© Copyright IBM Corp. 1981, 1995

189

Installing File Update at the Base Location
To get started, you need to install File Update at the base location - the first
system or location you want to install on. This procedure creates an installation
diskette, which is used to install File Update at a remote location.
Notes:

• A blank, formatted diskette is required.
• The base system must have PC DOS 7 installed.
• The base location is the client machine for a system connected by Local Area
Network (LAN) or the InterLnk program-a program that establishes a
communications link between two types of computers connected with a cable.
• Use the TAB key to move from one input field to another. You can also use the
mouse to click on an entry field or button.
• Windows Users: To access the DOS command prompt, select the PC DOS
Prompt icon in the PC DOS 7 Tools group.
To install File Update at the base location:

1. At the DOS command prompt, type:

fileup
2. Press ENTER. The Welcome screen is displayed.

If you receive a Bad command or fi 1e name message, make sure the program
files (FILEUP.EXE and FILEUP.HLP) exist on your system. These files are
installed with PC DOS and are usually found in the DOS subdirectory.

190

PC DOS User's Guide

If File Update appears without a Welcome screen, the program has been
installed. To reinstall, select Delete Installation from the Setup menu, and
begin again with step 1.
3. Select Cant i nue. The Location Names screen is displayed.
Work

.

Home

to save names and proceed to

4. Create names to identify your base and remote locations (for example,
WORK and HOME). Enter these names in the input fields.
5. Select Conti nue. The Program Path screen is displayed.

6. Make sure that the path listed is correct for the remote location program files
(FILEUP.EXE and FILEUP.HLP).
File Update assumes the remote location path is the same as the base location
path. If the program files are not in the remote location path, you will not be
able to install File Update at the remote location.

Chapter 12. Using File Update

191

7. Select Conti nue. The Add/Delete Directory Pairs screen is displayed.

8. Enter the drive and directory path, including all subdirectories, where you want
File Update to track files (see "Notes" on page 193). Select Add after you enter
a directory pair-the names of the directories you want to synchronize on the
base and remote locations.
For example, if you type C:\COMPUTER\SALES at the base location and
D:\SALES at the remote location, files in the C:\COMPUTER\SALES
subdirectory are updated in D:\SALES at the remote location when you transfer
the files.

192

PC DOS User's Guide

Notes:

• The path you specify for the base location must currently exist. However,
when a path does not exist at the remote location, it can be created for you
when you transfer your updated files.
• You can come back after installation to add or delete directory pairs.
Directory pairs can be the same drive and directories, different drives and
directories, or the same drive but different directories.
• InterLnk and LAN Users: Specify the actual drive and path (not the
remapped value). In other words, you know that drive G on your client
machine equals drive C on your server. Do not specify drive G directories.
File Update provides for drive remapping later in the process.

• If you make a mistake or want to delete a directory entry:
a. Choose the directory entry in the Directory List.
b. Select Delete to erase the directory information for both locations.
9. Select Conti nue. The Diskette Drive Selection screen is displayed.

10. Choose the diskette drive (drive A or 8) where you want to create the File
Update installation diskette.
11. Insert a blank, formatted diskette in the specified drive, and select Conti nue.
12. Select OK when installation is completed.
13. Label your diskette "File Update Installation", and set it aside. You will use it
later to install the File Update system files at the remote location.
If your remote location is connected through LAN or InterLnk, you do not need
to use the File Update Installation diskette again. You only need to remap the
drives.

Chapter 12. Using File Update

193

You have just completed File Update installation at the base location. Go to "Using
File Update Menu Choices" to review menu choices and set up your system.

Important:
The Fil es Bei ng Excl uded choice in the Setup menu contains a default list of file
extensions that are not being tracked. Be sure to review this list so that you do not
have files missing when you transfer file updates. You can add extensions to the
"excluded" list so that specific file types are not tracked. You can also delete any
file extensions that you want File Update to include in its tracking.

Using File Update Menu Choices
After you install File Update at the base location, use menu choices to set up your,
system. Keep in mind that the Files Being Excluded choice in the Setup menu
contains a default list of file extensions that are not being tracked. It is a good idea
to review this list and make any necessary changes.

CAUTION:
Use care when deleting extensions from the default list. These extensions are
excluded so that you do not replace files by mistake. For example, suppose you
have a program named "ChartMaker" at both locations. You have version 1.0 on
the base system and version 2.0 on the remote system. If you delete the "DLL"
extension from Files Being Excluded, you will replace files with an incorrect DLL
version, and ChartMaker will not run.
There are many useful choices from the Setup menu.

194

You Can:

Setup Menu Choice:

Add or delete directories you want tracked
(including all subdirectories).

Add Directory Pairs

Exclude specific file extensions from being tracked.
(Files without extensions are always tracked.)

Files Being Excluded

Monitor specific file names
(even if you excluded the file extension).

Override Excluded Files

Create an installation diskette
(if you need to create another installation diskette).

Create Installation Diskette

Delete installation
(to begin again and reinstall File Update).

Delete Installation

Display the path where the program files 'reside at the
base and remote locations.

Display Install Data

PC DOS User's Guide

You can also select choices from the File Update menu.
You Can:

File Update Menu Choice

Preview - Display the files you updated since the last
transfer and the number of diskettes you will need to
complete the transfer.
Update Files - Transfer updated files to diskette so you
can transfer files from one location to the other.
Custom File Selection - Control the type of update you
want. You can copy:

Update To Diskette

• Changed files for all directory pairs
• All files for all directory pairs
• Changed files for all "selected" directory pairs
(Use this choice after you complete your first update.)

Preview - Display the files on diskette that you are going
to transfer.
Update Files - Transfer updated files from the diskettes
created in Update to Diskette.

Update From Diskette

Preview - Display the files you updated since the last
transfer.
Update Files - Transfer updated files from your base
location.
Custom File Selection - Control the type of update you
want. You can copy:

Update Connected System.

• Changed files for all directory pairs
• All files for all directory pairs
• Changed files for all "selected" directory pairs

Re-Map Connected Drives - Remap drive letters.
(Connected drive letters can change if you connect to a
LAN or use a program such as InterLnk.)

Chapter 12. Using File Update

195

Transferring Updated Files to the Remote Location
Now that you have installed· File Update at the base location and set up your
system, resume work on your files. When you are ready to transfer updated files to
the remote location, follow the procedure for your particular remote location:
Remote System

Procedure

PC (not connected through
InterLnk or LAN)

"Installing on a PC."

PC (connected through InterLnk)

"Installing on an InterLnk-Connected
System" on page 200.

Local Area Network (LAN)

"Installing on a LAN-Connected System" on
page 202.

To find out more about the InterLnk program, refer to Chapter 11, "Connecting
Computers" on page 175.

Installing on a PC
Follow these procedures if the remote location is a PC, or another drive or partition
'
on the same PC.
1. "Transferring Updates from the Base Location to Diskette."
2. "Installing File Update at the Remote Location" on page 198.
3. "Transferring Updated Files to the Other Location" on page 199.

Transferring Updates from the Base Location to Diskette
To transfer updates to the remote location, you must first transfer updated files to
diskette. After you transfer files from the base location to the remote location the
first time, use this procedure to transfer files back and forth from one location to
another.

It is not necessary to manually copy and align files at both locations before using .
File Update.

196

PC DOS User's Guide

To transfer updates to diskette:

1. Select Fi 1e Update.
2. Select Update To Di skette.
You have the option to:
a. Select Previ ew to display the estimated number of diskettes (by media type)
it takes to copy the files that File Update is tracking.
b. Select OK. The Status screen is displayed with a list of the files to be
copied. It also indicates that you are connected to the appropriate drives (if
applicable).
If you want to remove the status screen, press F5.
3. Select Fi 1e Update.
4. Select Update To Di skette.
5. Select Update Fi 1es.
A message is displayed asking if you used your last update diskettes.
• If this is the first time you are doing a file update, select Yes.
• If you have done an Update to Diskette before but did not transfer the
updated files to the other location, select No to make sure all file changes
are transferred.
6. Insert a formatted diskette into the specified drive, and then select Conti nue.
,7. To overwrite any data on the diskette, select Yes; otherwise, select No.

8. Remove the diskette and label the first diskette "#1" and continue inserting
diskettes (as prompted) until all updated files are copied to diskette.
If you have multiple diskettes, label them with the correct sequential number so
that you can insert them when prompted at the remote location.
Important:
When you go to your other system to update your files, be sure to run Update From
Di skette before performing any other functions (for example, adding or deleting
directory pairs).

Go to "Installing File Update at the Remote Location" on page 198 if you are
installing File Update for the first time.
If you have already installed File Update at both your locations, go to "Transferring
Updated Files to the Other Location" on page 199.

Chapter 12. Using File Update

197

Instaliing File Update at the Remote Location
Follow these steps to install File Update if the remote location is a PC (not
conn,ected through a LAN or the InterLnk program).

Notes:
• Before you begin, you must have completed "Installing File Update at the Base
Location" on page 190 and "Using File Update Menu Choices" on page 194.
• The remote system must have PC DOS 7 installed.
• Make sure you have the File Update Installation diskette before you begin.
• This procedure has to be done only once (unless you select Delete
Installation from Setup and have to begin again).
• The following steps apply to "unconnected" PCs. If you are using InterLnk or a
LAN, se~ 'Transferring Updated Files to the Remote Location" on page 196 for
the correct procedure to follow.
To install the File Update Utility at

aremote location:

1. From the DOS command prompt, type:
fileup
2. Press ENTER.
If you receive a Bad command or fi 1e name message, make sure the program
files (FILEUP.EXE and FILEUP.HLP) exist on your system. These files are
installed with PC DOS and are usually found in the DOS subdirectory.
3. Select Remote Setup at the Welcome screen.
4. Insert the File Update Installation diskette you created on your base system in
diskette drive A or B.
5. Specify the drive where you inserted the diskette, and select Cont i nue.
6. Select OK when the installation is completed.

198

PC DOS User's Guide

Transferring Updated Files to the Other Location
Follow these steps to transfer updated files that you copied to diskette in
"Transferring Updates from the Base Location to Diskette" on page 196. Follow
this procedure before performing any setup activities at the remote location (such
as adding directory pairs or changing the excluded file list).

To transfer updated files that you copied to diskette:
1. Select Fi 1e Update.
2. Select Update From Di skette.
3. Select Update Fi 1es.
4. Insert the last diskette of the set that contains the updated files that you
transferred.
5. Select Yes to continue.
6. Continue to insert and remove the applicable diskettes. You are prompted with
a message indicating the number of the diskette to be inserted.
You might come across one or more of the following situations: '

Files Changed in Both Locations
If a file on your system is new or changed since your last update, a message
will be displayed with the name, the date stamp, and the time stamp of each
file. You are given the choice to keep a specific file or to replace all remaining
files. This lets you skip further messages and replace all conflicting files with
the updates from diskette. This message can occur when you work on the
same file at your base and remote locations and you do not update on a
regular basis. It can also occur if an update is not allowed to run to completion.
No Directory Path Exists for a File Listed on the Diskette
If a directory path does not exist for a file on the diskette, a message will be
displayed. You are given the choice of having the system create the directory
or of skipping the file and continuing the update process.
Drives Not Connected
If you are not connected to the drives you need, an error message will be
displayed. You cannot proceed with the update until you connect to these
drives.
File Update is now installed and can be run from both locations. Be sure to
perform a File Update at your base and remote locations on a regular basis.

Chapter 12. Using File Update

199

Installing on an InterLnk-Connected System
Follow these steps to use File Update on two systems connected by means of the
InterLnk program and a cable.
Notes:

• Before you begin, you must have completed "Installing File Update at the Base
Location" on page 190 and "Using File Update Menu Choices" on page 194.
• Make sure that you are connected to your server.
• You are not required to use the File Update Instal!ation diskette if you run File
Update from only one system. However, the installation directory for the
remote system that you specified in the initial installation must exist before you
can perform any update.
• For more information on the InterLnk program, refer to Chapter 11, "Connecting
Computers" on page 175.
To remap your drives:

1. Start the InterSvr program on your remote system and the InterLnk program on
your base system.
2. At the DOS command prompt on your base location, type:
fileup

3. Press ENTER.
4. Select Fi 1e Update.
5. Select Update Connected System.
6. Select Re-Map Connected Dri ves. The Connected Drive Remapping screen is
displayed.

200

PC DOS User's Guide

7. Specify the remapped drive letters used to access the remote drives. These
are listed under Other Computer (Cl i ent) on the InterSvr screen.
For example, on the system from which you ran the InterSvr program, you see
a listing of connected drives similar to the following:

This Computer
(Server)

Other Computer
(Client)

A:

equals

F:

C: (44MB)

equals

G:

D: (44MB)

equals

H:

LPT1:

equals

LPT2:

You specified the actual remote drive letters when you completed the
Add/Del ete Di rectory Pai rs screen. These drives are listed under Thi s
Computer (Server) on the InterSvr program screen.
8. Select OK. You are returned to the main screen;

9. Go through the selection process again of:

• Fi 1e Update
• Update Connected System
• Preview, Update Files, or Custom File Selection
You have completed File Update installation. You can choose to install File Update
on your server machine if you want to transfer files back and forth between
systems.

Chapter 12. Using File Update

201

Installing on a LAN-Connected System
Follow these steps to use File Update on a system connected to a Local Area
Network (LAN). You do not need to use the File Update Installation diskette
because you are only remapping drives (not installing File Update).
Notes:

• Before you begin, you must have completed "Installing File Update at the Base
Location" on page 190 and "Using File Update Menu Choices" on page 194.
• Make sure that you are connected to your network drives.
• File Update is always run from the client machine.
To remap your drives (you have to do only once):

1. At the DOS command prompt on your base location (client), type:

fileup
2. Press ENTER.
3. Select Fi 1e Update.
4. Select Update Connected System.
5. Select Re-Map Connected Dri yes. The Connected Drive Remapping screen is
displayed.

6. For drive letters currently specified in Di rectory Pai rs, specify the remapped
drive letters used to access the server drives.
Novell Network Users: The mapping for the base/remote location is the same
drive letter.

202

PC DOS User's Guide

7. Select OK. You are returned to the main screen.

8. Go through the selection process again of:

• Fi 1e Update
• Update Connected System
• Previ ew, Update Fil es, or Custom Fil e Sel ect ion
You have completed File Update installation on your LAN-based system.

Troubleshooting
For troubleshooting tips for the most common questions about or problems with File
Update, refer to "File Update Utility" on page 313.

Chapter 12. Using File Update

203

204

PC DOS User's Guide

Chapter 13. Making More Memory Available
RAM Boost is the memory management tool provided with PC DOS. It runs on a
80386SX**-based or higher processor that has enough extended memory available.
For more information about system requirements, see "RAMBoost System
Requirements" on page 207.
The purpose of RAM Boost is to determine the optimal memory location for every
device driver, terminate-and-stay resident (TSR) program, and other programs you
have designated for your system. It carries out this process by analyzing your
computer's existing configuration and automatically reconfiguring programs to load
above 640K after restarting your system. When RAM Boost is through processing,
you should have the maximum amount of available memory to use for your DOS
and Windows applications.
If you are having trouble running your programs because there is not enough
memory, you might need to run RAM Boost. For most systems, this simply means
typing ramsetup at the DOS command prompt and following the directions given
through the online RAM Boost program. When you have provided the information
RAMBoost needs to run, it takes care of everything else during its processing.
Of course, the more you understand about your system and memory, the more you
will appreciate all that RAM Boost can do for you. For a detailed discussion about
memory and additional RAMBoost tips and techniques, see "Using RAMBoost Tips
and Techniques" on page 218.
If you are a PCMCIA user, see "Running RAMBOOST with PCMCIA
(Non-Thinkpad)" on page 227 for information about running RAMBOOST with
PCMCIA.

Determining Your System's Memory Type
Before running RAM Boost, you should determine what type of memory your system
has and which programs are currently loaded into memory. Use the MEM
command with the Ie switch or use the QCONFIG command. For example, if you
used the MEM command, you might type the following at the DOS command
prompt:
mem /e /p

**

80386SX is a trademark of the Intel Corporation.

© Copyright IBM Corp. 1981, 1995

205

The Ie switch provides you with a list of programs and classifies their memory into
types of memory, such as conventional or upper memory. It is the upper memory
blocks that are used by RAM Boost to free conventional DOS memory. The /p
switch pauses the information at the end of each screen of information.
If you want to use the QCONFIG command, a more complete description of the
QCONFIG command can be found in "Analysis of Your Computer's Memory" on
page 221.

Understanding How RAMBoost Works
RAMBoost manages the area of memory of your computer from 640K to 1024K,
called upper memory blocks (UMBs). RAMBoost runs invisibly on your computer,
optimizing available memory automatically each time your computer's system
configuration changes. If you add or remove programs from your CONFIG.SYS or
AUTOEXEC.BAT files, RAMBoost automatically detects the change. When the
system is rebooted, RAMBoost automatically re-optimizes and rearranges the
remaining drivers in upper memory.
RAMBoost works with a memory manager. A memory manager (such as EMM386,
Quarterdeck QEMM**, and Qualitas 386MAX**) makes the open areas in your upper
memory blocks available for loading memory-resident programs and device drivers
(referred to as "loading high"). Loading programs high makes more DOS
conventional memory available for your applications. The amount of upper memory
RAM Boost makes available is determined by the expanded memory specification
(EMS) manager used with it.
Because the open space in upper memory is usually in several pieces of different
sizes, programs can fit in some areas but not in others. RAMBoost arranges your
memory-resident programs, device drivers, and other DOS resources such as those
specified in the CONFIG.SYS file (for example, FILES and BUFFERS) into upper
memory. This increases the amount of memory available for DOS to run
applications. RAMBoost does this by creating an initialization profile (.INI file) of
your memory usage and by automatically arranging the programs in your upper
memory blocks. This provides the maximum compatible amount of free
conventional memory. See "Using RAM Boost Tips and Techniques" on page 218
for more information about memory types.

**
**

Quarterdeck QEMM is a trademark of Quarterdeck Office Systems.
Qualitas 386MAX is a trademark of Qualitas, Inc.

206

PC DOS User's Guide

You configure RAM Boost once. Then, each time you start your computer,
RAM Boost analyzes your computer's resident programs and device drivers, selects
the optimal loading configuration, and loads them into upper memory blocks.
Important:
RAMSETUP must be run for each configuration that you want to optimize in a
multiple configuration setup. This way, an .INI profile file is generated for each
separate configuration. Your system needs to be rebooted twice for each
configuration. The first time RAMBoost locks in the configuration in the Learn
mode; and the second time, it makes it active. See page 210 for more information.

If you are familiar with memory-management techniques, you can customize
RAM Boost's performance by manually editing the settings in the profile .INI files.
The two primary .INI files are RAMSETUP.INI and RAMBOOST.INI. Additional .INI
files are generated when RAM Boost detects multiple configurations. For more
information about the .INI files associated with RAM Boost, see the online
PC DOS 7 Command Reference.

RAMBoost System Requirements
The following items are required to use RAM Boost Setup (run RAMSETUP).
RAMBoost Setup is flexible in that it works with many memory managers.
• A minimum of 512K available extended memory.
• A 80386SX-based or higher processor.
• For upper memory block support, at least 640K and an EEMS/EMS 4.0 memory
manager are required. Use one of the following EEMS/EMS 4.0 memory
managers:
HIMEM.SYS and EMM386.EXE provided with DOS
Quarterdeck Expanded Memory Manager-386**
- Qualitas BlueMAX** and 386MAX
Helix** Netroom**
Most of these third-party memory managers requires an adjustment to your
CONFIG.SYS file before running RAMBOOST. If you are running RAMBOOST
and install a third-party memory manager on over it (without adjustments), your
system might not work correctly. If this happens, check the third-party
documentation for instructions, or contact the manufacturer of the third-party
product.

** Quarterdeck Expanded Memory Manager-386 is a trademark of Quarterdeck Office Systems

**
**

BlueMAX is a trademark of Qualitas, Inc.
Helix and Netroom are trademarks of Helix Software Company
Chapter 13. Making More Memory Available

207

Refer to "Compatibility with Memory Managers and Other Programs" on
page 225 for compatibility information.

Configuration Requirements
You use the RAMSETUP.EXE program to configure RAMBoost. When loaded,
RAM Boost automatically checks for the existence of memory managers, such as
HIMEM.SYS and EMM386.EXE, on your system. Then, it scans upper memory to
configure itself with the optimal parameters for managing upper memory.
You need to take the following into consideration before you configure RAM Boost:
• Ensure that you load all the software you normally run in your daily routines
that start your adapter cards (for example, a sound blaster card). RAM Boost
Setup scans the upper memory area looking for unused adapter memory. If
you do not have your adapter activated, RAM Boost Setup might incorrectly use
the adapter memory space.
• If you are using QEMM386, 386MAX, or Netroom, you must install it according
to its installation instructions before you start RAMBoost. You must also make
sure it provides upper memory blocks (UMBs).
• When installing RAMBOOST in a multiple configuration environment, it is
necessary to configure each MENUITEM before allowing RAMBOOST to run an
optimization process.
1. Boot your system and load the first MENUITEM to be optimized.
2. Start the RAMSETUP program and configure the first MENUITEM. When
configured, allow RAMSETUP to reboot your system.
Do not load the same MENUITEM. Loading the same MENUITEM forces a
premature Learn process that would need to be re-optimized later.
3. Load the next MENUITEM to be configured for RAM BOOST optimization.
4. Start RAMSETUP, configure the MENUITEM, and then allow RAMSETUP
to reboot your system.
5. Continue this procedure with each MENUITEM of your multiple
configuration.
When you have configured each MENUITEM (as needed), reboot your system.
As each MENUITEM is loaded, RAMBOOST is ready to perform as intended. It
will learn and optimize each MENUITEM as it is loaded without the extra Learn
modes.

208

PC DOS User's Guide

To configure RAMBoost:
1. From the DOS command prompt, type:

ramsetup
2. Then press ENTER.
RAM Boost Setup reads the RAMSETUP.INI and RAMBOOST.INI profiles and
configuration files, and then displays a window. Which window is displayed
depends on whether EMM386 is installed in memory.

No EMM386 or equivalent statement installed

-

RAMBoost

'

RAMSETUP will now modify your CONFIG.SYS and
AUTOEXEC.BAT files. Choose OK to continue or choose
Advanced to configure RAMBoost manually. To exit the
RAMBoost setup program, choose Exit.

_n_

_mw DUNnam'
. - - - - -...

i

--~

EMM386 statement or equivalent installed
jt;1;':lmg
RAMSETUP will now nodify your COHFIG.SYS and
AUTOEXEC.BAT files.
HOTE: RAMSETUP can prouide the nost thorough upper
nenory analysis at this tine if EMM386 is not
installed. Choose OK to let RAMSETUP reinstall
EMM386 to configure naxinun DOS upper nenory. Choose
Keep to continue with the current EMM3B6. To exit
RAMSETUP. choose Exit. Choose Aduanced to configure
RAMBoost nanually. If you configure RAMBoost
nanually. choose Keep when you return to this
screen.

- - _ ..............._..

_ - _.._._.......

Any of the following scenarios are possible, depending on what programs exist
in your CONFIG.SYS file when RAM Boost Setup is run:

Scenario 1
• If RAM Boost Setup detects that you have no memory manager installed but
finds the DOS memory manager on your computer, select OK on the
window that is displayed. RAM Boost, EMM386, and HIMEM (if it was not
present) are installed into your CONFIG.SYS file. Go to step 3 on
page 211.

Chapter 13. Making More Memory Available

209

Scenario 2
• If RAM Boost Setup detects that you have installed a memory manager
other than the one in DOS, select OK on the window that is displayed.
RAM Boost is installed into your CONFIG.SYS file. Go to step 3 on
page 211.

Scenario 3
• If RAM Boost Setup detects that you have an EMM386 statement in your
CONFIG.SYS file, you have the option of letting RAMBoost comment out
(places the REM command before the statement) the statement and install
a new EMM386 statement that optimizes your system. Select OK. Your
system is rebooted and RAMSETUP is restarted automatically.
You can select and use the Advanced button to make changes to your
memory situation. After making your changes, you must select Keep and
then select Reboot.

Note: Use Advanced only if you are very familiar·with upper memory
concepts and management.
A second possibility exists for this scenario. You could get a message
screen that reads:

RAMSETUP will not install because there is only xxx amount
of memory available.
When this occurs, you have the following options:
- Select OK to let RAM Boost Setup uninstall your current EMM386 and
install an EMM386 statement that optimizes your system.
- Select Advanced so that you can manually allocate the stated xxx
amount of upper memory needed. After making the change, select
Keep and then select Reboot.

Scenario 4
• If RAMBoost Setup cannot find a memory manager on your computer, it
'
informs you that you must install one.

Scenario 5
• If you have multiple configurations and want to dictate how RAM Boost
Setup is to handle your configurations, RAM Boost Setup detects the
multiple configurations and displays a window. When you select
Reorgani ze, RAMBoost Setup rearranges the commands in your common
section and includes any statements it determines are needed for optimal
compatibility with each configuration.

210

PC DOS User's Guide

You can change or limit what RAM Boost will do to each configuration by
making changes in the appropriate .INI file. For more information, see the
online PC DOS 7 Command Reference.
If you select Reorgani ze, the old CONFIG.SYS is saved as CONFIG.SAV.
After RAM Boost Setup installs RAM Boost in your CONFIG.SYS file, a window
is displayed that allows you to reboot (restart) your computer or exit.

RAM SETUP needs to reboot your computer to determine
the best fit for your resident programs and drivers
in upper memory blocks. Please be sure there are no
diskettes in your diskette drives and choose Reboot
to begin this process. Choose exit if you do not want
RAMSETUP to reboot your computer at this time.

If you select Exi t, RAMBoost will be activated the next time you start your
computer. Be careful not to change your CONFIG.SYS or AUTOEXEC.BAT in
the meantime.
3. Select Reboot to start RAM Boost.
RAM Boost restarts your computer twice before RAM Boost is activated.
The first reboot:
RAM Boost Setup loads all your memory-resident programs as usual and keeps a
record of how much memory is used and how the programs are placed in memory.

After restarting your computer, you see the following:
RAMBOOST will automatically load in 3 seconds.

Choose:

Iyl to continue.
INI to prevent RAMBOOST from loading.

Load RAMBOOST

[YIN]?

RAMBOOST is loaded in LEARN mode.
Chapter 13. Making More Memory Available

211

The second reboot:
RAMBoost actually arranges the programs to fill your upper memory as much as
possible. You should then find a noticeable increase in conventional memory
available for running applications. You now see displayed on the last line:

RAMBOOST is loaded in ACTIVE mode.
This message is followed immediately· by the display of the DOS command prompt
signifying that RAM Boost is loaded.
After this, each time you start your computer, RAMBoost is loaded. Whenever you
restart your computer, if RAM Boost determines that one of the system files it tracks
has been altered (such as your AUTOEXEC.BAT or CONFIG.SYS files) or some
other special condition has changed, RAMBoost automatically enters LEARN mode
to optimize your computer's new configuration.

Learn Mode
During Learn mode, RAM Boost is working to determine the optimal location for
every object loaded since (and including) the loading of RAM Boost. This can be a
long process. A feature of RAM Boost is a progress bar that shows the current
status of Learn.
The progress bar shows the actual percentage of the possible combinations that
have been looked at.
RAMBoost defaults to a default timer type of el apsed, meaning you get only the
progress bar and a message indicating how much time has elapsed. However, you
can change the timer type in the RAMSETUP.INI file to an eta timer type.
\

When the timer type is set to eta, the time display provides an estimate of how
much longer the processing will take. This estimate is based on how long it has
taken to process the current fraction of the job.

Analyzing Your Computer's Memory after Running RAMBoost
After RAM Boost is loaded, you might want to do the following to verify that you do
have more conventional memory available:
• View your CONFIG.SYS file. Lines similar to the following are placed in this file
if you successfully loaded RAM Boost:

device=c:\dos\emm386.exe noems ram x=a000-b0ff i=b100-b7ff x=b800-bfff
device=c:\dos\ramboost.exe load

212

PC DOS User's Guide

The i = and x= are INCLUDE and EXCLUDE statements. The ••. means that,
although more of these statements are normally included in this DEVICE
statement, they are all not listed for this example.
• Save the output by typing:

mem Ie

>

filename.ext

where filename.ext is the name of the output file (for example, SAVE2.0UT).
The MEM command is preferred in this case rather than QCONFIG, because it
gives more details about your programs' upper memory.
You should see information similar to the following:

Modules using memory below 1Mb:
Name
Total
-------- ---------------IBMDOS
11088 (11K)
SMARTDRV
31024 (30K)
HIMEM
768
(lK)
EMM386
3392
(3K)
RAMBOOST
10688 (l0K)
ANSI
(4K)
3648
DPMS
1552
(2K)
STACHIGH
16169 (l6K)
COMMAND
2656
(3K)
DOSKEY
1152
(lK)
IBMAVSH
5424
(5K)
MOUSE
17280 (l7K)
FREE
702816 (686K)

Conventional + Upper Memory
---------------- ---------------(0K)
11088 (11K)
0
2448
(2K)
28576 (28K)
768
(lK)
0
(0K)
(3K)
3392
0
(0K)
(OK)
320
10368 (l0K)
48
(0K)
(4K)
3600
1552
(2K)
0
(0K)
48
(0K)
16112 (l6K)
272
(0K)
2384
(2K)
(0K)
1152
0
(lK)
(0K)
5424
(5K)
0
(0K)
17280 (l7K)
0
635408 (621K)
67400 (66K)

• Print the output from the MEM command after you have run RAMSETUP.
• Compare the two printed outputs (before and after running) if you printed or
saved the output from the MEM command before running RAMSETUP.
. For most individuals, running RAMBoost should give you more conventional
memory than you had before running it. If it does not, you might have to manually
manipulate the upper memory blocks or run RAMBOOST OPTIMIZE 1. See the
online PC DOS 7 Command Reference for information about editing your
RAMBOOST.INI file.

Chapter 13. Making More Memory Available

213

Reviewing What RAM Boost Changes
RAMBoost Setup modifies your CONFIG.SYS file. Some of the following changes
might be noted:
• A RAMBOOST.EXE statement is placed in your CONFIG.SYS file.
• An EMM386 statement is created if you choose to have RAMBoost Setup
comment out (using the REM command) any previous EMM386 statement. Or,
a new EMM386 statement is created if one was not already present.
• The DEVICEHIGH statements have become DEVICE statements, because
RAM Boost now controls your upper memory blocks.
• ' For multiple configurations and single configurations, the following changes are
made:
- The AUTOEXEC.BAT file is backed up toa file named AUTOEXEC.CPS.
- The CONFIG.SYS file is backed up to a file named CONFIG.CPS.
-

For multiple configurations only, an .INI file is created for each possible
configuration in which RAMSETUP was run, matching the name of the
CONFIG variable currently active.

Using Advanced Features
,Use these advanced features only if you are very familiar with upper memory
concepts and manage,ment.

RAMBoost runs by itself with minimal user interaction. It is possible, however, to
customize the way RAM Boost uses the upper memory blocks of your computer.
There are two ways you can work with advanced RAMBoost features:
• Using the Upper Memory Usage Editor
• Editing the appropriate .INI file

The Upper

Me~ory

Usage Editor

The Upper Memory Usage Editor is an advanced feature of the RAM Boost memory
manager. The Upper Memory Usage Editor allows you to:
• View your current upper memory usage
• Make changes to your upper memory usage
You can use the Upper Memory Usage Editor to reserve upper memory blocks for
devices that might not identify their upper memory usage during RAM Boost's setup
and installation. These devices can be network or special video boards. You can
also use the editor to make more upper memory blocks available. For example, if

214

PC DOS User's Guide

you know of an available region of upper memory blocks that appears unavailable,
you can use the editor to change the status of the blocks from allocated to
available.

To start the Upper Memory Usage Editor:
1. From the DOS command prompt, type:
ramsetup

2. Then press ENTER.
If RAM Boost Setup detects that you have the DOS memory 'manager installed,
RAM Boost Setup provides you with an Advanced option button.
3. Select Advanced.
The following table shows status symbols for each block:
This Symbol

Indicates
An available memory block.
An occupied memory block.

RO

A block allocated for ROM.

VI

A block allocated for video RAM.

EM

A block allocated for the EMS frame.

AD

A block allocated for adapter RAM.

To change the current memory usage of a block:
1. Select the block you want to change, using the mouse or pressing the TAB key
to start the editor and then using the arrow keys.
2. Select the function key that corresponds to the type of memory specification
you want to apply.
Refer to "Function Keys" for more information.
3. Repeat steps 1 and 2 until you have modified upper memory to your
satisfaction.
4. Select OK to save the changes.

Function Keys: The table on the following page shows the function keys you can
use in the Upper Memory Usage Editor.

Chapter'13. Making More Memory Available

215

Function Key

Description

F1 HELP

Provides online help.

F2 AVAIL

Makes the selected memory blocks available for another use.

F3 EXIT

Exits from the program.

F4ROM

Changes selected memory-block usage to ROM.

F5 VIDEO

Changes selected memory-block usage to video RAM.

F6 EMS

Changes selected memory-block usage to EMS frame.

F7 ADAPT

Changes selected memory-block usage to RAM adapters.

Fa DEC

Switches between the display of memory-block addresses in decimal
and hexadecimal characters.

Using the Options Editor
This' dialog box lets you set the number of XMS (extended memory specification)
. handles, DMA support and· the size of your DMA (direct memory access) buffer.
The default values are correct for most personal computers (pes). You can also
enable or disable EMS (expanded memory specification) memory and specify
whether your computer has a Weitek** coprocessor.
These options correspond to command-line options for the DOS memory manager,
EMM386.
Option

Description

XMS Handles

Specifies the number of extended memory handles EMM386 can use,
from 2 to 255. If you use many programs simultaneously that use
extended memory, you may need to increase this number.

DMA Buffer

Specifies how many kilobytes of memory to reserve for Direct Memory
Access (DMA). This should be the largest DMA transfer that occurs
while EMM386 is active, and it can be from 16 to 256. The default
value is optimized to work on most PCs.

Enable EMS

Enables
memory
memory
requires
memory

Weitek

Enables support for the Weitek coprocessor. If your computer uses this
coprocessor, enable this feature.

EMM386 to access expanded memory by designating a
area for page swapping, which is required for expanded
orientation. You can enable EMS if a program you use
it. If you do not need it, you will have more available upper
if you leave it disabled.

** Weitek is a trademark of the Weitek Corporation.

216

PC DOS User's Guide

To use the Options Editor:
1. Select Opt; ons from the Upper Memory Usage Editor menu.

Dspays Upper
MemoryBock stah.Js

110

m

EO 1lO

llO

nu

..... ...- -- - -- - - -- ".... -- - - -IIU III ru m RJ m rn:J 110 III lllJ m rn:J to
HJ 11) FO 1lO RO

Jl{I

III liO

m

llO

m

00

~O

- 1I.~llablc
.. OccupIed

m
in

Key to stiius syntcls
aspayed in fie Upper
'Memory USaJe EeJ"tor
pa7eI.

IIn~

Uj<

represents the reserved upper memory range.

2. Record the value indicated for the reserved memory. You will use t~is as a
guide when running RAMSETUP to allocate the available upper memory for
RAMBOOST.
3. Type ramsetup at the DOS command prompt.
4. Select Advance.
5. TAB or click on the Upper Memory Usage Editor.
6. Click on the desired location or use the Arrow Keys to move the highlight to the
desired location.

Chapter 13. Making More Memory Available

229

7. Press F2 to set the space to -- (Available) and make that space (memory
range) available to RAMBOOST.
8. Repeat until all desired ranges are edited.
For example, if you see the following statement in your CONFIG.SYS file:

device=c:\pcmcia\dicrmu01.sys /ma=c000-cfff
You would need to set an available range of DOOO-DFFF in RAMSETUP for
RAM BOOST to run without a memory conflict.

To adjust the PCMCIA Version 2.1 release for RAM BOOST
1. View your CONFIG.SYS file for the statement:

DEVICE=C:\PCMCIA\DICRMU01.SYS /MA=xxxx-xxxx
where >