|
|
|
Lecture 3 |
|
Using MS-DOS C.L.I. (1) |
|
|
|
|
MicroSoft - Disk Operating System |
|
C.L.I. – Command Line Interface |
|
Commands are typed in. |
|
No Mouse! |
|
Older 16 Bit operating system |
|
G.U.I. provided by Windows 3.x |
|
Now generally regarded as obsolete. |
|
|
|
|
Microsoft tried to “kill” DOS as a separate OS
in 1995 with release of Windows 95. |
|
The last official release of DOS was V6.22 |
|
DOS survived as an integral part of Windows 9x
Operating Systems. |
|
Available as Command Prompt on NT, 2000 and Xp
versions – though not integral to the OS. |
|
Can to useful when managing your computer, your
network and for creating batch files. |
|
|
|
|
|
A:
Floppy Disk Drive |
|
C: Hard
Disk Drive |
|
D: CD
ROM / DVD / CD-RW (Usually) |
|
\ used
to denote the root directory |
|
A:\ is the root directory of the floppy disk |
|
Also used to separate directories |
|
A:\Letters\Granny01.doc |
|
|
|
|
|
In windows 9x, press F8 when you boot up system |
|
Select Command Prompt Only from menu |
|
Places you in full MS-DOS mode |
|
From shutdown menu, select Restart in MS-DOS
Mode |
|
Places you in full MS-DOS Mode |
|
In Windows, select Command Prompt or MS-DOS
Prompt from Start Menu. |
|
Enter Command into “Run” |
|
|
|
|
|
|
cd \
Moves user to root directory |
|
To move to a specific drive, enter drive code
and press enter. |
|
A: Moves user to Floppy Drive |
|
C: Moves user to Hard Disk |
|
D: Moves user to CD/DVD/CD-RW |
|
|
|
Prompt may look like this: |
|
C:\windows> |
|
|
|
|
|
Format prepares a disk for use by placing the
file system on the disk. |
|
Syntax: |
|
format drive: |
|
Examples: |
|
format A:
or format C: |
|
This formats disk to default size. |
|
|
|
|
|
Switches can be added to alter the way the Format
command operates: |
|
/Q Quick Format (rewrites FAT only) |
|
/F:size Specifies size of the disk |
|
720, 1.44, 2.88 |
|
160, 180, 320, 360, 1.2 |
|
/S Format as System Disk |
|
(Command.com, IO.sys, MSDOS.sys) |
|
|
|
|
|
Directories are made using the commands: |
|
md (or mkdir) |
|
Syntax: |
|
md directory-name |
|
Example: |
|
md letters |
|
This would make a directory called letters at
the users current location (disk and directory) |
|
|
|
|
|
The command(s) to change directory are cd (or
chdir) |
|
Syntax: |
|
cd path |
|
The path can be absolute or relative (see next) |
|
Example: |
|
cd windows |
|
This would move the user into the windows
directory – which must be a sub-directory of the current directory. |
|
|
|
|
|
Absolute Paths |
|
The complete route to a location on a disk. |
|
The Path starts from the root directory of the
disk in question |
|
Relative Paths |
|
The route to a location on a disk from where you
currently are. |
|
|
|
|
|
Location C:\windows |
|
You want to go to system which is a
sub-directory of C:\windows, then into viewers which is a sub-directory of
System |
|
Using Relative Path |
|
cd system\viewers |
|
Using absolute path |
|
cd c:\windows\system\viewers |
|
|
|
|
Generally a directory must be empty to delete
it. The commands to do this are: |
|
rd (or rmdir) |
|
Syntax: |
|
rd directory |
|
Example: |
|
rd letters |
|
This would delete an empty directory called letters
relative to your current location. |
|
|
|
|
|
Sometimes you want to delete an entire branch of
your file-system. |
|
Manually emptying each directory to remove it is
time-consuming. |
|
Use deltree command |
|
This removes directory and all sub-directories
and files. |
|
Deltree letters |
|
In 2000 and Xp, deltree is not available. Its function is achievable using rd with
the /s switch (not available in Win9x) |
|
rd /s letters |
|
|
|
|
|
Files can be copied or moved. |
|
Copy |
|
File is copied to new location |
|
Now 2 “copies” available, the original and the
new copy |
|
Move |
|
File is copied to new location and the original
is removed |
|
Only 1 copy remains, in the new location |
|
|
|
|
|
Syntax: |
|
copy source destination |
|
Examples: |
|
copy letter1.doc c:\data\letter2.doc |
|
copy letter1.doc c:\data |
|
What is the difference between the 2 commands
above |
|
|
|
|
|
Syntax: |
|
move source destination |
|
Examples: |
|
move letter1.doc c:\data\letter2.doc |
|
move letter1.doc c:\data |
|
What is the difference between the 2 commands
above |
|
|
|
|
Both these commands have switches that can be
used to make their actions more powerful. |
|
Use the on-line help to check what these are. |
|
Both can utilise Wildcards. |
|
|
|
|
The commands to delete a file are del (or erase) |
|
Syntax: |
|
del filename |
|
Example: |
|
del letter01.doc |
|
|
|
|
|
Again, wildcards can be used with del |
|
Under Win9x there are a couple of switches
available. |
|
2000 & Xp provide several switches that
allow very powerful results to be achieved, including: |
|
Deletions based on attribute settings |
|
Forcing deletion of read-only files |
|
Confirmation prompts |
|
|
|
|
|
Use the /? Switch with any command to get a
brief help page |
|
Cd /? |
|
Format /? |
|
If you have a fully copy of DOS you can enter help
to get the full DOS Help system. |
|
|
|
|
|
Files with the following extensions can be
directly invoked by the user |
|
.com |
|
.exe |
|
.bat |
|
Type in their DOS filename and press enter. |
|
You don’t need to enter the extension itself. |
|
Standard rules regarding absolute and relative
paths apply. |
|