Professional Documents
Culture Documents
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.
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:
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:
[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:
" Copy con " (create a new text file and input text ):
Syntax: copy con filename.txt