Introduction to MS-DOS

advertisement
Department of Computer Science
 Operating System is a set of software that controls and
manages hardware and basic system operation of a
computer.
 The operating system loads programs into the
computer’s memory, runs these programs, and
manages peripherals like disk and printers.
 Example : Disk operating system (DOS) , Windows,
Linux, Mac, Unix
 MS-DOS Means Microsoft Disk Operating System
 MS-DOS is a disk-based, single user, single task and
character based user interface operating system. The
role of DOS is to interpret commands that the user
enters via the keyboard. These commands allow the
following tasks to be executed:





file and folder management
disk upgrades
hardware configuration
memory optimization
program execution
 Developed to run single-user, stand-alone desktop computers.
 Exemplifies early Operating Systems because it manages jobs
sequentially from single user.
 Advantages:
1. Simple operation & straight-forward user commands.
 Disadvantages:
1. Lack of flexibility & limited ability to meet needs of programmers &
experienced users.
2. Written for a single family of microprocessors (Intel family of chips:
8086, 8088, 80186, and 80286).
Evolution of MS-DOS
User
COMMAND.COM
DOS Kernel
BIOS
Hardware
MS-DOS
ACCESSING MS-DOS FROM WINDOWS
The command line interface (CLI) can be accessed in two ways from Windows 7 operating
system.
 Start >> Programs >> Accessories >> click Command Prompt to access the CLI
 Start >> Type cmd in the Search box, click cmd to access the CLI
DOS COMMANDS : DIR
The DIR command is used to list all files and directories in the
current directory
E.g C:\Users\Mrhope > DIR will give the output below
DOS COMMANDS : CD
The CD command is used to navigate into another directory.
Example 1. C:\Users\Mrhope > CD Desktop
Example 2. C:\Users\Mrhope > CD\
Example 3. C:\Users\Mrhope > CD..
 In Example 1, the current directory will be changed to Desktop.
Note that Desktop exist in the current directory
 In example 2, the current directory will be changed to the root of
the drive. i.e C:\
 In example 3, it takes the current directory one directory back i.e
C:\Users >
DOS COMMANDS : MKDIR or DM
The MKDIR command is used to create a new directory.
Example 1. C:\Users\Mrhope > MKDIR Test
Example 2. C:\Users\Mrhope > MD C:\Test
 The Above command in example 1 will create a new directory
called “Test” in the current directory (Mrhope)
 In example 2, new directory named Test is created in C:\
directory
DOS COMMANDS : FORMAT
The FORMAT command is used to erase all data on a drive.
Example 1. C:\Users\Mrhope > FORMAT a:
Example 2. C:\Users\Mrhope > FORMAT a: /q
 The Above commands in example 1 and 2 will both erase data
from drive A.
 In example 2, a quick erase will be performed due to the /q
option provided in the command
DOS COMMANDS : COPY
The COPY command is used to copy one or more files to alternate
location.
Example 1. COPY *.* a:
Example 2. COPY file1.txt C:\test
 In example 1, all files in the current directory is copied to drive a
 In example 2, file1.txt is copied to test directory in drive C
DOS COMMANDS : LABEL
The LABEL command is used to view or change the label of the
computer disk drives
Example 1. LABEL a: mydisk
The above command will change label on drive A to mydisk
DOS COMMANDS : DEL
The DEL command is used to delete files from the computer.
Example. DELETE test.tmp
The above command will delete test.tmp file from the computer
NOTE : Files Deleted from MS-DOS go to the recycle bin.
DOS COMMANDS : RMDIR
The RMDIR command is used to delete a directory from the
computer.
Example. RMDIR test
The above command will delete test directory in the currect
directory from the computer
ADVANCE COMMANDS : DRIVERQUERY
Drivers remain among the most important software installed on a
PC. Improperly configured or missing drivers can cause all sorts of
trouble, so its good to have access to a list of what’s on your PC.
That’s exactly what the “driverquery” command does. You can
extend it to “driverquery -v” to obtain more information including
the directory in which the driver is installed.
Example 1. C:\ > driverquery
Example 2. C:\ > driverquery –v
The out put for the commands are shown in the next slide
ADVANCE COMMANDS : DRIVERQUERY
Example 1 Output
Example 2 Output
ADVANCE COMMANDS : CHKDSK
Chkdsk is a very important command that is used to perform disk
management task (i.e scan disk for errors). This command can be
used to correct disk anomalies like corrupt boot sector, file indexing
error, disk bad sector e.t.c
Example 1. C:\ > chkdsk d:
Example 2. C:\ > chkdsk d: /f
 Example 1 will do a general scan on disk D and reports any error
encountered.
 Example 2 will scan and fix any error found on the D
ADVANCE COMMANDS : IPCONFIG
This command relays the IP address that your computer is currently
using. However, if you’re behind a router (like most computers
today), you’ll instead receive the local network address of the router.
Example 1. C:\ > ipconfig
Example 2. C:\ > ipconfig /release
C:\ > ipconfig /renew
Example 3. C:\ > ipconfig /flushdns
 Example 1 gets all the IP address for enabled network devices.
 Example 2 forces your Windows PC into asking for a new IP address,
which is useful if your computer claims one isn’t available.
 Example 3 refreshes your DNS address
ADVANCE COMMANDS : NETSTAT
Netstat command will provide you with a list of currently open ports
and related IP addresses
Example 1. C:\ > netstat -an
 You’ll also be told what state the port is in – listening, established
or closed. This is a great command if you’re trying to troubleshoot
the devices your PC is connected to or you’re afraid you’re
infected with a Trojan and are trying to locate a malicious
connection.
ADVANCE COMMANDS : PING
Typing “ping” followed by an IP address or web domain will send a
series of test packets to the specified address. If they arrive and are
returned, you know the device is capable of communicating with
your PC; if it fails, you know that there’s something blocking
communication between the device and your computer.
Example 1. C:\ > ping www.google.com
 The output of the above command is shown below
ADVANCE COMMANDS : POWERCFG
Powercfg is a very powerful command for managing and tracking
how your computer uses energy.
Example 1. C:\ > powercfg /hibernate on
Example 2. C:\ > powercfg /hibernate off
Example 3. C:\ powercfg /a
 Example 1 and 2 is used to manage hibernation by turning it on
and off respectively.
 Example 3 is used to view the power-saving states currently
available on your PC.
ADVANCE COMMANDS : ATTRIB
The attrib command can be used to restore hidden files as a result of
virus or malware attack.
Example 1. C:\ > attrib –s –h /s /d *.*
 The above commands works magically to restore all file hidden or
system protected by virus. This is very useful when a thumb or
flash drive is infected with virus make all the files on it not
accessible.
 Ensure that you change directory to the root directory of the
infected drive.
ADVANCE COMMANDS : SFC
SFC command is a System File Checker that launches automatic scan
and repair tool that focuses on Windows system files. You will need
to run the command prompt with administrator privileges.
Example 1. C:\ > sfc /scannow
 When the above command is executed, If any corrupt or missing
files are found, they’ll be automatically replaced using cached
copies kept by Windows for just that purpose. The command can
require a half-hour to run on older notebooks. Ensure that you
change directory to the root directory of the infected drive.
USEFUL TIPS
 MS-DOS and the Windows command line are not case sensitive.
 The files and directories shown in Windows are also found in the
command line.
 When working with a file or directory with a space, surround it in
quotes. For example, My Documents would be "My Documents."
 Filenames can have a long file name of 255 characters and a 3
character file extension.
 When a file or directory is deleted in the command line, it is not
moved into the Recycle Bin.
 If you need help with any of command type /? after the
command. For example, dir /? would give the options available
for the dir command.
Download