Sunday, October 7, 2007

DOS: Using the DATE and TIME commands

Changing the systems DATE and TIME:
DATE
TIME
CHKDSK and SCANDISK

DOS: Using the ERASE, RENAME, and MOVE commands

ERASE command:
FUNCTION: To delete s file or group of files from the disk.
TYPE: Internal
FORMAT: ERASE filespec or DEL[ETE] filespec

A user can also change the name of a file, a group of files, or a directory.

RENAME command:
FUNCTION: To change the name of a file or group of files
TYPE: Internal
FORMAT: REN[AME] filespec filename [ext.]

MOVE command:
FUNCTION: To change the name of a directory
TYPE: Internal
FORMAT: move

DOS: Using the COPY and DISK COPYcommands

The COPY command is used to copy one or more files from one disk to another. It allows the user to make an additional copy of a given fie on the same disk but with a different file name.
TYPE: Internal
FORMAT: COPY [d:] filespec [d:] [filename [.ext]]
*The user can copy files from any directory to any other, HOWEVER, both the source and target directories must be unambiguously specified as we did above when were were moving and creating directories.

The DISKCOPY command allows the user to copy one diskette onto another. DISKCOPY makes an exact copy of the source disk on the target disk.
TYPE: External
FORMAT: DISKCOPY [d:] [d:]

DOS: What you need to know about directories

A directory is a "table of contents" that lists all the files in an operating system. In DOS when one enters a command the operating system access the file by using the name to look up the track and sector information in the directory.
As seen on the command list posted before...DIR stands for directory, and its function is to list the directory of the disk, thus allowing the user to see the files located on the disk.
TYPE: is Internal thus it is performed by the "command.com."
FORMAT: DIR [d:] [filename [.ext] ] [/p] [/w]

DOS allows the user to create additional directories on a disk. These directories are called SUBDIRECTORIES. The directory that contains them is called the "parent directory."
DOS' three commands for dealing with directories:
1. MD: used to create a new directory
2. RD: to remove a directory (but can only be done if empty)
-DELTREE: allows the user to remove a subdirectory structure even if its NOT empty.
3. CD: allows the user to move from one directory to another. (CD command changes
the active directory.)
4. TREE: display all the subdirectories from any point in the directory tree.


*To move any directory to the root of the drive the user types: ed \
WHY? Because the "\" refers to the root.
*To move from any directory to its immediate parent directory the user types ed ..
WHY? Because the two dots are the way to refer to the parent.
-What does one dot do?
cd. leaves the user in the directory they are in.
-What if one simply enters cd?
It will cause DOS to output a "fully qualified path" (the exact path needed to get to a
file or drive) for the current directory.

DOS: A Command List

CHKDSK: Checks the status of a disk and prepares the status report
CLS: Clears the display monitor
COPY: Copies one or more files
DATE: Changes the system date
DEL: Deletes one or more files
DIR: Lists the files in the directory
DISKCOPY: Copies a complete diskette
ERASE: Deletes one or more files
FORMAT: Prepares a disk for use
RENAME: Renames a disks files
TIME: Changes time of the system
TYPE: Displays file contents on the monitor

DOS: What is it for?

In using DOS one can create directories and subdirectories using series of commands.

For example, some of these commands are:
FORMAT - a command used to prepare a disk for use
COPY - used to make a copy of a file
DIR - used in order to list the names of all the files on a specific disk
CHKDSK - used to check the characteristics of the disk and system
DOS also allows one to...
- Run programs
- Keep track of files on a disk
- Handle input and output

Important need to know DOS commands from DOS's perspective and from that of the user:
There are INTERNAL and EXTERNAL commands.
1. Internal commands are from DOS's perspective, and are commands that are contained
in "command.com."
For example:
DIR, COPY, TYPE, DATE, TIME etc.
2. External commands are not contained in the program "command.com." Every time DOS needs to execute them, it must load them from the disk.
For example:
CHKDISK, DISKCOPY, FORMAT

From the user's perspective:
Date: Date
Time: Time
File: COPY, DEL, DIR, ERASE, RENAME, TYPE
Disk: SCANDISK, DISKCOPY, FORMAT