`
`Ex. GOOG 1004
`
`EX. GOOG 1004
`
`
`
`
`
`
`
`
`
`
`
`EX. GOOG 1004
`
`Ex. GOOG 1004
`
`
`
`Critical acclaim for
`Running MS-DOS@
`
`"Running MS-DOSproves how-to books don't have to be pedantic, ugly and full
`of mistakes. A book even the PC mavens turn to, it is written by a human
`being for human beings, in a strange and wonderful tongue: English."
`
`PC Week
`
`'This book is simply the definitive handbook ofPGDOS and MS-DOS ... written
`for both novices and experienced users."
`
`BYTE
`
`"Running MS-DOS combines a lucid presentation of MS-DOS commands and
`functions with sound advice on approaching the basic housekeeping chores
`that all PC users need to perform. It's presented in a highly readable format
`that includes plenty of useful examples."
`
`PC World
`
`"If you're new to MS-DOS, Van Wolverton's Running MS-DOSis essential. This
`well-written volume has become a classic and is a must-have for serious PC
`users. If you can only buy one MS-DOS book, buy this one."
`
`Compute!
`
`"Excellent guide for computer novices. The tone is informal yet direct.
`Features are clearly defined and illustrated. Good one-book reference."
`
`Computer Book Review
`
`"One of the most popular MS-DOS books is Van Wolverton's RunningMSDOS."
`
`PC Magazine
`
`"Describes in clear terms what MS-DOS can do to help you manage your
`system. The nice thing about this book is that it is written to show how com(cid:173)
`mon daily tasks can be made easier with MS-DOS, making the user, rather
`than the technology, the focus of the tutorials."
`
`The New York Times
`
`"An invaluable reference text written in plain English and loaded with practi(cid:173)
`cal information and help .... [It includes] one of the most practical and easiest(cid:173)
`to-use listings of MS-DOS commands that I've seen. As in the rest of the book,
`Wolverton's lucid writing style brings a new level of understanding to this
`important part ofMS-DOS."
`
`Online Today
`
`Ex. GOOG 1004
`
`
`
`" ... essential for those who want to get the most out of their PCs."
`
`The Washington Post
`
`"Running MS-DOS is well organized and clearly written. Van Wolverton goes to
`great lengths to explain the commands rather than just show you how to use
`them."
`
`PCResuurce
`
`''This is truly the conerstone book for any serious MS-DOS user's library."
`
`Computer Shapper
`
`"Running MS-DOS has become a sort of operating system bible for PC
`owners .... Wolverton's easygoing style and Microsoft's lavish use of illustrations
`make this one of the best MS-DOS books on the market."
`
`Dallas Morning News
`
`" ... clearly guides you through the mazes of computer disk operating systems
`for any IBM PC or IBM compatible."
`
`New York Daily News
`
`"For anyone eager to get the most from any or all of the currently available
`versions of MS-DOS, Running MS-DOS is the book of choice."
`
`Library of Computer and
`Information Scieru:es
`
`"Ru'nning MS-DOS succeeds where others fail because it begins on a simple
`level, yet doesn't bore the reader or talk down to the reader. You can learn
`more from it than any other single volume available-including the instruc(cid:173)
`tions which come with your computer and software."
`
`Regional News of the
`Advertising Prifession Monthly
`
`"If you want to learn something about the IBM disk operating system, the best
`bet is still a tome called Running MS-DOS. Wolverton assumes you are a literate
`adult, and that's about it. The result is a no-nonsense explanation of how an
`IBM-compatible works, and how to make it work for you."
`
`Baltimore Evening Sun
`
`"If you want to thoroughly understand the operating system that drives IBM
`and compatible machines, get Van Wolverton's Running MS-DOS."
`
`The Atlantajuunuzl
`
`Ex. GOOG 1004
`
`
`
`I 0 f--1 ).,.') :::,·
`2? 0' G H
`;-;;,;; /..
`-2.
`)(C.CN,c._~ 1\);\;
`
`..
`
`®
`
`VERSION 6.2
`
`®Van Wolverton
`
`Ex. GOOG 1004
`
`
`
`PUBLISHED BY
`Microsoft Press
`A Division of Microsoft Corporation
`One Microsoft Way
`Redmond, Washington 98052-6399
`
`Copyright© 1994 by Van Wolverton
`
`All rights reserved. No part of the contents of this book may be reproduced or transmitted
`in any form or by any means without the written permission of the publisher.
`
`Library of Congress Cataloging-in-Publication Data
`Wolverton, Van, 1939-
`Running MS-DOS I Van Wolverton. -- 6th Rev. ed.
`p. em.
`Includes index.
`ISBN 1-55615-633-2
`I. MS-DOS (Computer file)
`QA76.76.063W65 1993
`005.4' 469--dc20
`
`I. Title.
`
`Printed and bound in the United States of America.
`
`4 5 6 7 8 9 AG-M 9 8 7 6 5 4
`
`93-37565
`CIP
`
`Distributed to the book trade in Canada by Macmillan of Canada, a division of Canada Publishing
`Corporation.
`
`A CIP catalogue record for this book is available from the British Library.
`
`Microsoft Press books are available through booksellers and distributors worldwide. For further
`information about international editions, contact your local Microsoft Corporation office, or
`contact Microsoft Press International directly at fax (206) 936-7329.
`
`IBM is a registered trademark of International Business Machines Corporation. Microsoft
`and MS-DOS are registered trademarks and Windows is a trademark of Microsoft Corporation.
`All other trademarks and service marks are the property of their respective owners.
`
`Acquisitions Editor: Dean Holmes
`Project Editor: Maureen Williams Zimmerman
`Manuscript Editor: Barbara Browne
`Technical Editor: Dail Magee,Jr.
`
`Ex. GOOG 1004
`
`
`
`Contents
`
`Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
`Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
`
`GETTING TO KNOW MS-DOS
`
`1 What Is MS-DOS?
`
`3
`
`MS-DOS Is a Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
`Hardware Makes It Possible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
`Software Makes It Happen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
`MS-DOS Is a Disk Operating System
`. . . . . . . . . . . . . . . . . . . . . . . . . . . .
`5
`What Can You Do with MS-DOS? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
`7
`Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
`
`2 Starting MS-DOS
`
`9
`
`Starting the System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 0
`The System Prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
`Entering MS-DOS Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
`Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
`Keeping Track of the Date and Time . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
`Changing the Current Drive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
`Printing What's on the Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
`Clearing the Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
`Turning the System Off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
`Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
`
`3 Getting Your Bearings
`
`23
`
`The Directory .......................... ·. . . . . . . . . . . . . . . . . . . . . . . . 24
`Displaying a Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
`Some Important Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
`Restarting the System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
`A Short Diversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 7
`Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
`
`Ex. GOOG 1004
`
`
`
`RUNNING MS-DOS
`
`4
`
`A look at Files and floppy Disks
`
`41
`
`Types of Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
`How Files Are Named . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
`Preparing for the Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
`Qualifying a Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
`Displaying Specific Directory Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
`Preparing a Floppy Disk for Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
`Creating a Text File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
`Some Advanced Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
`Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
`
`Part II: lEARNING TO USE MS-DOS
`
`5 Managing Your Files
`
`59
`
`The MS-DOS File Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
`File Names and Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
`Preparing for the Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
`Wildcard Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
`Help When You Need It . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
`Displaying Directory Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
`Displaying a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
`Making Copies of Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4
`Sending Files to Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
`Combining Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
`Deleting Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
`Changing File Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
`Comparing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
`Printing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
`
`6 Managing Your Floppy Disks
`· - - - - - -
`Handling Floppy Disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
`Backing Up Your Floppy Disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
`How Information Is Stored on a Floppy Disk . . . . . . . . . . . . . . . . . . . . . 96
`Preparing for the Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
`Preparing a Floppy Disk for Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
`
`93
`
`X
`
`Ex. GOOG 1004
`
`
`
`Contents
`
`Copying a Complete Floppy Disk .............................. 1 03
`Comparing Two Floppy Disks ................................... 105
`Checking the Condition of a Disk .............................. 1 07
`Assigning or Changing a Disk's Volume Label .................. 110
`Displaying a Disk's Volume Label ............................... 110
`
`7 Managing Your Devices
`
`113
`
`Device Names ................................................ 115
`Preparing for the Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
`Checking System Memory with the Mem Command ........... 116
`Clearing the Screen ............................................ 118
`Fine-Tuning the Keyboard ..................................... 118
`Controlling the Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
`Controlling the Printer Width and Spacing . . . . . . . . . . . . . . . . . . . . . . 120
`Controlling the Serial Communications Port . . . . . . . . . . . . . . . . . . . . 123
`Connecting a Serial Printer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
`Finding Out About Your System ................................ 126
`Copying from a Device to a File or Another Device ............. 128
`Printing Graphics Images ...................................... 129
`Changing the Keyboard Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
`
`8 A Tree of Files
`
`135
`
`Defining a Subdirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
`Preparing for the Examples .................................... 137
`Creating a Multilevel File Structure ............................. 137
`Adding More Levels to Your File Structure ...................... 144
`Managing Your Subdirectories ................................. 154
`Chapter Summary ............ · ................................. 166
`
`9 Managing Your Hard Disk
`
`169
`
`Putting Application Programs on Your Hard Disk ................ 171
`Preparing for the Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
`Changing the Attributes of a File or a Directory ................. 174
`Copying Selected Files ........................................ 180
`Stretching Your Hard Disk ...................................... 187
`
`xi
`
`Ex. GOOG 1004
`
`
`
`RUNNING MS-DOS
`
`Storing Files Efficiently on Disk .................................. 196
`MS-DOS and Your Hard Disk .................................... 198
`Chapter Summary ............................................. 201
`
`10 Protecting Your Disks and Files
`
`203
`-----------------------
`Recovering Deleted Files ...................................... 205
`Reformatting and Unformatting Disks ........................... 214
`Guarding Against Virus Programs .............................. 217
`Developing a Backup Procedure .............................. 223
`Backing Up and Restoring Files with MSbackup ................. 223
`Backing Up Files with the Backup Command ................... 232
`Restoring Files to the Hard Disk with the Restore Command ..... 237
`
`11 The MS-DOS Shell
`---- ---------------------------- - - - - - - -
`Starting the Shell .............................................. 242
`Help Is a Keystroke Away ...................................... 246
`The File List .................................................... 248
`The Program List ............................................... 263
`
`241
`
`12 Creating and Editing Files of Text
`
`279
`
`Using the Keyboard and the Mouse ............................ 280
`Starting Edit .................................................... 282
`Help .......................................................... 282
`Entering Lines ................................................. 286
`Adding Text to a File ........................................... 286
`Where's the Margin? .......................................... 287
`Printing a File ....................... , .......................... 288
`Saving a File .................................................. 289
`Deleting Text .................................................. 290
`Ending an Editing Session ...................................... 291
`Editing an Existing Text File ..................................... 291
`Searching for a Group of Characters .......................... 293
`Replacing One Group of Characters with Another ............. 293
`Inserting and Overstriking Text ................................. 294
`Copying from Another File ..................................... 295
`
`xii
`
`Ex. GOOG 1004
`
`
`
`Contents
`
`Changing the Screen Display .................................. 296
`Chapter Summary ............................................. 297
`
`13 Taking Control of Yom System
`
`299
`
`Redirecting Command Output ................................ 300
`Redirecting Command Input .................................. 301
`Filter Commands .............................................. 301
`Preparing for the Examples .................................... 302
`The Sort Filter Command ...................................... 303
`The Find Filter Command ...................................... 305
`More on Redirecting .......................................... 308
`Connecting Commands with a Pipe ........................... 31 0
`Editing an MS-DOS Command with Doskey ..................... 312
`Entering Multiple Commands with Doskey ...................... 314
`Chapter Summary ............................................. 315
`
`·14 Creating Your Own Commands
`
`317
`
`A Batch of What? ............................................. 318
`How MS-DOS Searches for a Command ........................ 318
`Creating the Sample Files ..................................... 319
`Creating a Batch File .......................................... 320
`Developing Your Own Startup Procedure ...................... 325
`Some Useful Commands ....................................... 329
`Creating Commands with Doskey ............................. 331
`
`15
`
`Smart Commands
`
`337
`
`Preparing for the Examples .................................... 338
`Creating an Archive Command ............................... 339
`Modifying the Sample Batch File ............................... 340
`Controlling System Messages .................................. 340
`Making the System Pause ...................................... 341
`Controlling Which Commands Are Carrried Out ................ 342
`Changing the Sequence of Commands ....................... 345
`Dressing Up Your Archive Command ........................... 349
`Chapter Summary ............................................. 352
`
`xiii
`
`Ex. GOOG 1004
`
`
`
`RUNNING MS-DOS
`
`16 Creating More Smart Commands
`
`353
`
`Preparing for the Examples .................................... 354
`Commands for Searching Through a File ....................... 354
`Some Useful Batch Files ........................................ 359
`Four Advanced Batch Commands ............................. 364
`Some More Useful Batch Files .................................. 374
`Chapter Summary ............................................. 377
`
`17 Tailoring Your System
`
`----- ··- ---~--------------------~---~---------- --------- --------~-~--------------------
`
`379
`
`Defining Your System Configuration ............................ 381
`Other Configuration Commands ............................... 396
`Commands for Occasional Use ................................ 399
`
`Part Ill: APPENDIXES
`
`A
`
`Installing MS-DOS ........................................... 405
`
`B Glossary ..................................................... 417
`
`C MS-DOS Command Reference ............................. 431
`
`Index .............................................................. 595
`
`xiv
`
`Ex. GOOG 1004
`
`
`
`
`
`Managing Your Files
`
`EX. GOOG 1004
`
`Ex. GOOG 1004
`
`
`
`he previous chapters defined a file as a named collection of re(cid:173)
`lated information stored on a disk and showed you several ways
`to create, copy, display, print, and otherwise work with your com(cid:173)
`puter files. This chapter describes the MS-DOS filing system in
`detail, showing you more about how files are named and how you can use
`MS-DOS to manage your computer files.
`
`NOTE: A few of the examples in the remaining chapters of this book may look
`familzar, because they repeat some of the examples in Chapters 2, 3, and 4. This
`repetition is intentional so that Chapters 5 through 17 present a complete guide to
`A1S-DOS commands. You won't have to refer back to Chapter 2, 3, or 4 for com(cid:173)
`mand descriptions.
`
`THE MS-DOS FILE COMMANDS
`To be useful, a filing system-whether it contains disk files or paper files-must
`be kept orderly and up to date. Using the MS-DOS file commands, you can
`manage your disk files much as you manage your paper files. This chapter covers
`the MS-DOS commands you use most often on a day-to-day basis. It shows you
`how to:
`
`• Display directory entries in different ways with the Directory
`command.
`
`• Display a file with the Type command.
`
`• Copy and combine files with the Copy command.
`
`• Send a copy of a file to a device with the Copy command.
`
`• Remove a file from a disk with the Delete command.
`
`• Change the name of a file with the Rename command.
`
`• Compare two files with the Compare command.
`
`• Print a file with the Print command.
`
`FILE NAMES AND EXTENSIONS
`As Chapter 4, "A Look at Files and Floppy Disks," pointed out, files are named so
`that you (and MS-DOS) can tell them apart; each file on a disk must have a differ(cid:173)
`ent name. You know that a file name can be up to eight characters long, made up
`of any letters or numbers; you can also use the following symbols:
`
`' - !@#$%A& ( )_ - { } \ '
`
`60
`
`_j
`
`Ex. GOOG 1004
`
`
`
`Chapter 5: Managing Your Files • ~.
`~w
`
`You can add a suffix-called an extension-to the file name to describe its
`contents more precisely. The extension can be up to three characters long and
`can include any of the characters that are valid for the file name. It must be sepa(cid:173)
`rated from the name by a period. The extension distinguishes one file from an(cid:173)
`other just as the name does: REPORT and REPORT.JAN, for example, are two
`different files, as are REPORT.JAN and REPORT.FEB. Figure 5-l shows some valid
`and invalid file names.
`
`These File Names
`Are Valid
`
`B
`93BUDGET
`BUDGET.93
`BUDGET.94
`BDGT(94)
`
`These Are Invalid ...
`
`Because
`
`1994BUDGET
`BUDGET.l994
`.94
`SALES 93.DAT
`$1,300.45
`
`Name too long
`Extension too long
`No file name
`Blank not allowed
`Comma not allowed
`
`Figure 5-1.
`Some valid and invalidfi!R names.
`
`Try to make file names and extensions as descriptive as possible. A short
`name might be easy to type, but you can have difficulty remembering what the
`file contains if you haven't used it for a while. The more descriptive the name, the
`more easily you can identify the contents of the file.
`
`Special Names and File Name Extensions
`Some names and file name extensions have special meanings to MS-DOS. As you'll
`see in Chapter 7, "Managing Your Devices," MS-DOS refers to the parts of your
`computer system by certain reserved names known as device names. The keyboard
`and screen, for example, are named CON, and the system clock is called CLOCK'$.
`You cannot use any of these device names as file names.
`Similarly, certain file name extensions have special meanings to MS-DOS.
`These extensions either are created by MS-DOS or cause MS-DOS to assume the file
`contains a particular type of program or data. You should avoid giving files any of
`these extensions. A number of the most important ones are listed in Figure 5-2 on
`the following page.
`Application programs also usually recognize special extensions. For ex(cid:173)
`ample, Microsoft Word, the Microsoft word processor, uses DOC to identify a
`document, BAK to identify a backup version of a document, and STY to identify a
`file that contains a style sheet of print specifications. Again, avoid using exten(cid:173)
`sions that have special meaning for your application programs; these extensions
`are usually listed in the documentation that comes with each program.
`
`61
`
`Ex. GOOG 1004
`
`
`
`PART II: LEARNING TO USE MS-DOS
`
`Name
`
`Meaning to MS-DOS
`
`BAS
`
`BAT
`
`COM
`
`EXE
`
`HLP
`
`OVL
`
`SYS
`
`Short for Basir. Contains a program written in the Basic
`programming language. You run the program while using
`Basic.
`Short for Batch. Identifies a text file you create that contains a
`set of MS-DOS commands that are run when you type the
`name of the file.
`Short for Command. Identifies a command file that contains a
`program MS-DOS runs when you type the file name.
`Short for Executable. Like COM, identifies a command file that
`contains a program MS-DOS runs when you type the file
`name.
`Short for Help. Contains a file of help text displayed by certain
`programs, including the MS-DOS Shell and the versions 5, 6,
`and 6.2 Editor and Basic programs.
`Short for Overlay. Identifies a command file that contains part
`of a large program.
`Short for System. Identifies a file that can be used only by
`MS-DOS.
`
`Figure 5-2.
`Some special MS-DOS file name extmsions.
`
`Specifying the Drives
`You can tell MS-DOS to look for a file in a specific drive by typing the drive letter
`and a colon before the file name. If you specify a file as a:report, for example,
`MS-DOS looks in drive A for a file named REPORT; if you specify the file as report,
`MS-DOS looks for the file in the current drive.
`
`PREPARING FOR THE EXAMPLES
`If your system isn't running, start it. Place a blank, formatted floppy disk in drive
`A. Then type the following to change the current drive to A:
`
`C:\>a:
`
`MS-DOS acknowledges by changing the system prompt:
`
`A:\>_
`
`Now you're ready to create a set of sample files on this floppy disk. Type the fol(cid:173)
`lowing; where you see AZ, hold down the Ctrl key and press Z (or press F6), then
`press Enter:
`
`62
`
`I
`
`_j
`
`Ex. GOOG 1004
`
`
`
`Chapter 5: Managing Your Files
`
`A:\>copy con report.doc
`This is a dummy file.
`Az
`
`MS-DOS responds:
`
`1 file(s) copied
`
`A:\>_
`
`Now that you've created this file, you can use it and the MS-DOS Copy command
`to create some more. Type the following Copy commands (described in detail
`later in this chapter) to create some other sample files.
`
`A:\>copy report.doc report.bak
`1 fi le(s) copied
`
`A:\>copy report.doc bank.doc
`1 file(s) copied
`
`A:\>copy report.doc budget.jan
`1 file(s) copied
`
`A:\>copy report.doc budget.feb
`1 file(s) copied
`
`A:\>copy report.doc budget.mar
`1 file(s) copied
`
`Now check the directory.
`
`A:\>dir
`
`It should list six files:
`
`Volume in drive A is EXAMPLES 1
`Volume Serial Number is 1A2C-13F5
`Directory of A:\
`
`REPORT
`REPORT
`BANK
`BUDGET
`BUDGET
`BUDGET
`
`DOC
`BAK
`DOC
`JAN
`FEB
`MAR
`6 file(s)
`
`23 10-16-93
`9:16a
`23 Hl-16-93
`9:16a
`23 10-16-93
`9:16a
`23 10-16-93
`9:16a
`23 10-16-93
`9:16a
`23 10-16-93
`9:16a
`138 bytes
`1210880 bytes free
`
`Remember, the time and date in your list will be different, but the file
`names and sizes (23 bytes) should be the same.
`
`63
`
`Ex. GOOG 1004
`
`
`
`PART II: LEAR N I N G T 0 U S E M S- D 0 S
`
`WILDCARD CHARACTERS
`To make it easier to manage your disk files, most file commands let you use wild(cid:173)
`card characters to handle several files at once. That way, when you want to do the
`same thing to several files-change their names, perhaps, or erase them-you
`don't have to enter a separate command for each file. You can use wildcard char(cid:173)
`acters to tell MS-DOS you mean a set of files with similar names or extensions. Just
`as a wild card in a poker game can represent any other card in the deck, a wild(cid:173)
`card character can represent any other character in a file name or extension.
`There are two wildcard characters, the asterisk ( *) and the question mark
`(?). The following examples use the Directory command to illustrate ways you
`can use wildcard characters to specify groups of files.
`
`Using the Asterisk Wildcard Character: *
`The asterisk makes it easy to carry out commands on sets of files with similar
`names or extensions; it can represent up to all eight characters in a file name or
`up to all three characters in an extension. If you use the asterisk to represent the
`entire name or extension, you are specifying all file names or all extensions.
`The following examples illustrate several ways to use the asterisk character
`to find selected directory entries. You can use the asterisk with other MS-DOS
`commands as well.
`To specify all files named BUDGET, regardless of extension, type the
`following:
`
`A:\>dir budget.*
`
`MS-DOS displays the directory entry of each sample file named BUDGET, regard(cid:173)
`less of its extension:
`
`Volume in drive A is EXAMPLES 1
`Volume Serial Number is 1A2C-13F5
`Directory of A:\
`
`BUDGET
`BUDGET
`BUDGET
`
`JAN
`FEB
`MAR
`3 file(s)
`
`9:16a
`23 10-16-93
`9:16a
`23 10-16-93
`23 10-16-93
`9:16a
`69 bytes
`1210880 bytes free
`
`To specify all file names beginning with B, type the following:
`
`A:\>dir b*
`
`If you don't specify an extension, the Directory command displays the entry
`for each file that matches the name, regardless of extension. (It's the equivalent
`of specifying the extension as*.) There are four such files:
`
`64
`
`_j
`
`Ex. GOOG 1004
`
`
`
`Chaptec 5, Managing Yooc file' ~
`
`Volume in drive A is EXAMPLES 1
`Volume Serial Number is 1A2C-13F5
`Directory of A:\
`
`BANK
`BUDGET
`BUDGET
`BUDGET
`
`DOC
`JAN
`FEB
`MAR
`4 file(s)
`
`23 10-16-93
`9:16a
`23 10-16-93
`9:16a
`23 10-16-93
`9:16a
`23 10-16-93
`9:16a
`92 bytes
`1210880 bytes free
`
`To specify all files with the same extension, regardless of name, you replace
`the name with *· For example, to specify each file with the extension DOC, type:
`A:\>dir *.doc
`
`MS-DOS displays just those entries:
`
`Volume in drive A is EXAMPLES 1
`Volume Serial Number is 1A2C-13F5
`Directory of A:\
`
`REPORT
`BANK
`
`DOC
`DOC
`2 file(s)
`
`9:16a
`23 10-16-93
`9:16a
`23 10-16-93
`46 bytes
`1210880 bytes free
`
`Using the Question Mark Wildcard Character: ?
`The question mark replaces only one character in a file name or extension. You'll
`probably use the asterisk more frequently, using the question mark only when one
`or two characters vary in the middle of a name or extension.
`To see how the question mark works, type the following:
`
`A:\>dir budget.?a?
`
`This command specifies all files named BUDGET that have extensions beginning
`with any character, followed by the letter a, and ending with any character. MS(cid:173)
`DOS displays two entries:
`
`Volume in drive A is EXAMPLES 1
`Volume Serial Number is 1A2C-13F5
`Directory of A:\
`
`BUDGET
`BUDGET
`
`JAN
`MAR
`2 file(s)
`
`9:16a
`23 10-16-93
`9:16a
`23 10-16-93
`46 bytes
`1210880 b~tes free
`
`65
`
`Ex. GOOG 1004
`
`
`
`PART II: LEARNING T 0 USE M S- D 0 S
`
`A Warning About Wildcard Characters
`Be careful using wildcard characters with commands that can change files. Sup(cid:173)
`pose you spent several days entering a year's worth of budget data into 12 files
`named BUDGET.JAN, BUDGET.FEB, BUDGET.MAR, and so on. On the same disk you
`also have three files you don't need named BUDGET.OLD, BUDGET.TST, and
`BUDGET.BAD. The disk is getting full, so you decide to delete the three unneeded
`files. It's 2 A.M., you're tired, and you're in a hurry, so you quickly type del budget.*
`and press Enter. You have told MS-DOS to do more than you wanted.
`You may realize immediately what you have done, or it may not dawn on you
`until you try to use one of the 12 good budget files and MS-DOS replies File not
`found. You display the directory; there isn't a single file named BUDGET, because
`you told MS-DOS to delete them all.
`With commands that can change or delete a file, use wildcard characters
`with extreme caution.
`This warning applies even if you have version 5 or later of MS-DOS, which in(cid:173)
`cludes a command named Undelete that can help you recover deleted files. Bear
`this in mind: Undelete cannot always recover files completely. As you'll see later in this
`book, Undelete can be valuable. But don't let it lull you into a false sense of
`security.
`
`HELP WHEN YOU NEED IT
`NOTE: lf you don't have version 5 or later of MS-DOS, your version of MS-DOS
`doesn't include the help ftature described here. Skip to the heading 'Displaying
`Directory Entries. "
`
`As you work with MS-DOS, you'll find that some commands become so familiar
`you type them without thinking. Others, which you need less often, will linger in
`your mind, but you may have to refresh your memory to use them correctly. If you
`have version 5 or later of MS-DOS, you have a feature called online help that you can
`call on whenever you want help with a command. Online help isn't intended to
`teach you how to use MS-DOS, but it is a handy guide that can remind you of the
`form of a command you haven't used in a while.
`To see a list of the commands for which you can request help, type help and
`press Enter:
`
`A:\>help
`
`Versions 6 and 6.2 of MS-DOS respond by displaying three columns of topics
`enclosed in angle brackets:
`
`66
`
`_j
`
`Ex. GOOG 1004
`
`
`
`You can scroll through this list one row at a time with the Up and Down ar(cid:173)
`row keys, or a screen at a time with the PgUp and PgDn keys. Press Tab to move
`from one column to the next, and press a letter to move the cursor to the first
`command that begins with that letter. To display information abou