You are on page 1of 10

Disk Operating System ( DOS )

The operating system is software which controls the hardware of machine and allows
the user’s programs and packages to be run on the machine.
DOS is a operating system that was commonly used on IBM-compatible personal
computers during the 1980s and early 1990s. DOS is a command-line based system,
meaning that users interact with computer by typing commands into a prompt rather
than using a graphical user interface.
To run a DOS command, you need to open a command prompt window. Here are the
general steps to do so:

1. Click on the Start menu in the lower left corner of your screen.
2. Type "cmd" (without quotes) in the search box and press Enter. This will open a
command prompt window.
3. Type the DOS command you want to execute, followed by any options or arguments
as needed.
4. Press Enter to execute the command.

Here are some commonly used DOS commands:


 DIR (Lists the contents of a directory) :
Syntax: DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
[/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]
 CD (Changes the current directory) :
Syntax: CD [/D] [drive:][path]
For example,
To change the current directory to C:\Windows, you would type:

To change the Windows directory on the D: drive, you would type:

 MD (Creates a new directory):


Syntax: MD [drive:]path
For example,
To create a new directory called myfolder on the C: drive, you would type:

 RD (Deletes a directory):
Syntax: RD [/S] [/Q] [drive:]path
For example,
To remove the directory myfolder and all its contents from the C: drive, you would
type:
 COPY (Copies a file from one location to another):
Syntax: COPY [/D] [/V] [/Y | /-Y] [/Z] [source] [destination]
For example,
To copy a file called file.txt from the current directory to a directory called backup
on the D: drive, you would type:

 DEL (Deletes a file):


Syntax: DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
For example,
To delete a file called file.txt in the current directory, you would type:

 REN (Renames a file or directory):


Syntax: REN [drive:][path]filename1 filename2
For example,
To rename a file called oldfile.txt to newfile.txt in the current directory, you would
type:

 TYPE (Displays the contents of a text file):


Syntax: TYPE [drive:][path]filename
For example,
To display the contents of a file called file.txt in the current directory, you would type:

 EDIT (Opens a text editor for creating or modifying a file):


Syntax: EDIT [/B] [/C] [/D] [/E] [/F] [/L] [/P] [/R] [/S] [/T] [/X] [/Y] [filename]
Here's a brief explanation of each option:
 /B: Forces the editor to load in monochrome mode.
 /C: Forces the editor to use the MS-DOS console.
 /D: Forces the editor to open as a data file editor.
 /E: Forces the editor to open as a European character set editor.
 /F: Forces the editor to use 80x43 mode.
 /L: Forces the editor to load with line numbers displayed.
 /P: Forces the editor to open as a printer text file editor.
 /R: Forces the editor to open as a read-only file.
 /S: Forces the editor to use the serial mouse.
 /T: Forces the editor to use the touch screen.
 /X: Forces the editor to use extended memory.
 /Y: Forces the editor to use a yellow background.

For example,
To open a file called file.txt in the editor, you would type:
 FORMAT (Formats a disk) :
Syntax: FORMAT [drive:] [/Q] [/FS:file-system] [/V:label][ /A:size] [/C] [/X]
[/P:passes]
Here's a brief explanation of each argument:
 [drive:]: Specifies the drive letter of the disk or partition you want to format.
 /Q: Performs a quick format, which does not check the disk for bad sectors. This
option is faster than a full format but is less thorough.
 /FS:file-system: Specifies the file system to use when formatting the disk or
partition. The file system can be FAT, FAT32, exFAT, or NTFS. If you don't specify a
file system, the default is NTFS.
 /V:label: Specifies a volume label to assign to the disk or partition.
 /A:size: Specifies the allocation unit size to use when formatting the disk or
partition. This option is not recommended for most users, as the default
allocation unit size is usually optimal.
 /C: Enables disk compression on the disk or partition. This option is only available
if the disk or partition is formatted with the NTFS file system.
 /X: Forces the volume to dismount if necessary before formatting. This option is
useful if the volume is in use and cannot be formatted otherwise.
 /P:passes: Specifies the number of zero-fill passes to perform during the format.
This option is used to overwrite the disk with zeros, which can help to erase any
data that was previously on the disk. By default, the FORMAT command
performs one pass of zero-filling.
For example,
To format a USB drive with the default NTFS file system, you would type:

 CHKDSK (Checks a disk for errors and repairs them if possible) :


Syntax: CHKDSK [drive:] [/F] [/R] [/X]
Here's a brief explanation of each argument:

 [drive:]: Specifies the drive letter of the disk or partition you want to check. If you
don't specify a drive letter, the command checks the current drive.
 /F: Fixes errors on the disk or partition. This option is automatically selected if the
disk or partition is in use and cannot be checked otherwise.
 /R: Locates bad sectors on the disk or partition and recovers any readable
information. This option implies /F and also includes the option to mark bad
sectors so that they are not used again.
 /X: Forces the volume to dismount if necessary before checking. This option is
useful if the volume is in use and cannot be checked otherwise.
For example,
To check and fix errors on the C: drive, you would type:

 XCOPY (Copies files and directories, including subdirectories and their contents) :
Syntax: XCOPY source [destination] [/A |/M] [/D[:date]][/P] [/S [/E]] [/V] [/W]
Here's a brief explanation of each argument:
 source: Specifies the path and filename(s) of the file(s) to be copied.
 destination: Specifies the path and filename of the destination directory or file. If
no destination is specified, the files are copied to the current directory.
 /A: Copies only files that have the archive attribute set, and clears the attribute.
 /M: Copies only files that have the archive attribute set, and does not clear the
attribute.
 /D[:date]: Copies only files that are newer than the specified date. If no date is
given, copies only files that are newer than the destination files.
 /P: Prompts before creating each file.
 /S: Copies directories and subdirectories, including empty ones.
 /E: Copies directories and subdirectories, including empty ones. This option is the
same as /S, but it also includes empty directories.
 /V: Verifies each file after copying it.
 /W: Prompts you to press a key before copying.
For example,
To copy all files and subdirectories from C:\Source to D:\Destination and verify each
file after copying, you would type:

 ATTRIB (Displays or modifies the attributes of a file or directory) :


Syntax: ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [drive:][path][filename] [/S [/D]]
Here's a brief explanation of each argument:
 +R or -R: Sets or clears the read-only attribute of a file or directory.
 +A or -A: Sets or clears the archive attribute of a file or directory.
 +S or -S: Sets or clears the system attribute of a file or directory.
 +H or -H: Sets or clears the hidden attribute of a file or directory.
 [drive:][path][filename]: Specifies the file or directory for which you want to
display or change attributes.
 /S: Applies the attribute change to all files in the specified directory and its
subdirectories.
 /D: Applies the attribute change to folders as well as files.
For example,
To remove the read-only attribute of a file named example.txt located in C:\Users\
Username\Desktop, you would type:
 PING (Tests the connectivity between two computers on a network):
Syntax: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count]
[-w timeout] destination
Here's a brief explanation of each argument:
 -t: Sends continuous ping requests until interrupted by the user.
 -a: Resolves the IP addresses of the pinged hostnames to hostnames, if possible.
 -n count: Specifies the number of ping requests to send. The default value is 4.
 -l size: Specifies the size of the ICMP data portion of the ping packet. The default
value is 32 bytes.
 -f: Sets the "Don't Fragment" bit in the IP header of the ping packet.
 -i TTL: Sets the Time to Live (TTL) value in the IP header of the ping packet.
 -v TOS: Sets the Type of Service (TOS) value in the IP header of the ping packet.
 -r count: Specifies the number of hops the ping packet can travel before being
discarded.
 -s count: Specifies the number of bytes in the ping packet's data portion.
 -w timeout: Specifies the timeout value in milliseconds for each ping request. The
default value is 4000 milliseconds.
 destination: Specifies the IP address or hostname of the device to ping.
For example,
To ping the IP address 192.168.0.1 and display the results in continuous mode:

 NET (Manages network resources, such as file shares and printers):


Syntax: NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP
| HELP | HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION
| SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]

Here's a brief explanation of each argument:


 ACCOUNTS: Displays a list of user accounts for a remote computer.
 COMPUTER: Displays or modifies the name of the current computer.
 CONFIG: Displays a list of server/workstation services running on a computer.
 CONTINUE: Resumes a paused service.
 FILE: Displays or modifies files opened by network users.
 GROUP: Displays or modifies global groups.
 HELP: Displays help information for net commands.
 HELPMSG: Displays help information for network error messages.
 LOCALGROUP: Displays or modifies local groups.
 NAME: Adds, deletes, or displays the computer name or domain name.
 PAUSE: Pauses a service.
 PRINT: Displays or manages print jobs and printer properties.
 SEND: Sends messages to other users or computers on the network.
 SESSION: Lists or disconnects sessions on a server.
 SHARE: Displays or modifies shared resources (files, printers, etc.).
 START: Starts a service.
 STATISTICS: Displays network statistics for a remote computer.
 STOP: Stops a service.
 TIME: Displays or sets the system time of a remote computer.
 USE: Connects to or disconnects from a shared resource.
 USER: Adds, deletes, or modifies user accounts.
 VIEW: Displays network resources and their connections.
For example,
To display a list of shared resources on a remote computer named Server01, you would
type:

 " Copy con " (create a new text file and input text ):
Syntax: copy con filename.txt

You might also like