Basic DOS How to get some work done
Basic DOS
How to get some work done
It’s all a file
• Everything is a file: OS files, Application files, Data files and Game files
• Files have 8.3 names: up to eight characters for name, a period, and up to three characters for file extension
• File names longer than this require quotes around the name
• We store files in Directories/Folders
Drives
• Drive “names” are single letters followed by a colon
• Properly, it is A: and B: for floppy disk drives
• Hard disk drives (and other drives) start at C: and go to Z:
• That means we can have 26 drives in a system
Changing Drives
• Type the drive letter followed by the colon and press <Enter>
• A:\> C: takes you to the C: drive
• C:\> A: takes you back to A: drive
• We can “address” or execute a file on another drive C:\> A:FDISK will run the program FDISK that is located on the A: drive
Directories
• We store files in Directories or Folders
• To see the file(s) in a directory, we typeA:\> DIR <Enter>
And we get a list of the files
Organizing Files
• Use directories and subdirectories; start with Root Directory (C:\)
Root DirectoryC:\
DataApps Stuff
FebJan
MyFile01MyFile01
MarThis is legal since fully qualified file name is:C:\Data\Jan\MyFile01
File name here is:C:\Data\Feb\MyFile01
Case
• DOS is not case-sensitive like most UNIX systems are – DIR, Dir and dir all mean the same
• The first thing the Command Interpreter does is to upper-case what you have typed
Internal and External
• COMMAND.COM is the Command Interpreter and consists of many “chapters” or includes many commands
• We call these “Internal Commands”• You don’t have to go anywhere or
reference anything to use these commands
• DIR, CD, RD, MD, COPY, MOVE are internal commands
Focus
• DOS is focused on the current directory and the “prompt” will tell you
• C:\DOS> means we are in the DOS directory of the C: drive
• If the command you typed is not an internal command, DOS looks in the current directory for the file/program
• DOS is also focused on the drive (C: above)
PATH
• The PATH is an environmental variable that holds a list of directories to search for a program
• C:\DOS;C:\WP5;A:\;D: is a valid path
• DOS will search the PATH for the program you requested if the PATH is set
Path
• Fully Qualified Name is also the Path (to the file):
• C:\Data\Jan\MyFile01
Path
File Name
Errors
• If DOS can do what you asked with the information provided, it usually does not say much
• If DOS can’t do what you asked, it returns an error Bad Command or File Name
Program Files
• DOS can only “run” three types of files and these end in .COM, .EXE or .BAT
• .COM and .EXE files are compiled (binary) files; .BAT files are text files that you can create and run
Additional Information
• Some commands do not require additional information, but most do
• DIR will give you a directory of the current directory, DIR c:\DOS would give you a directory of the DOS directory
• If the command expects more data and you don’t provide it, DOS will use current directory and/or drive
Make Directory
• MD <name> will create a new directory, under the current directory
• Name is eight characters no period and no extension (unless you are Microsoft)
• New directory will only have two entries:The “dot” file for current directory
The “double dot” file for parent (up one level) directory
Notice no response from MD
Changing Directories
• Use the CD <name> command
• Allows you to go down one level
• CD .. Will take you up one level
• You can get fancy, just watch carefully if you do!
Remove Directory
• Use RD <name> to remove the named directory that is directly below your current directory
• Removed directory has to be empty before you can remove it
Delete a file
• Use DEL <file name> to remove a file in the current active directory
Wild Cards
• The asterisk, shift-8, will replace up to eight characters. Thus *.* is any file with any extension
• The question mark will replace ONE character. Thus file? Would be file1, file2, file3 and so on
Copy
• Use COPY <what> <where> (note two parameters required, each separated by one (or more) spaces
• COPY A:\*.COM C:\DOS\*.* would copy all files with .com extension from the A: drive to the C:\DOS directory (directory must exist already)
space
space
FDISK
• Does not require any parameters – presumes you don’t have drive letters yet
• Is an External program; it is located in the root directory of A:
• To run it A:\ fdisk <Enter>
FORMAT
• DOES require a parameter: the drive letter you want to format
• It will be located on the RAM drive created when DOS loads from the startup disk
• The poor guy in Alaska
The Boot Process
• Part of DOS loads, with support (or not) for CD drive
• Creates a RAM drive; a section of memory (RAM) that gets a drive letter and can store files
• Uncompresses several files and places them in the RAM drive
• RAM drive will get next drive letter after hard disk drive and before CD drive