Search This Blog

Thursday, April 29, 2010

Disk Oerating System command and QuestionsAnswers

Disk Operating System

Operating System is a set of programs that is extremely important to activate and Co-Ordinate the activities of various hardware resources like the processor and Input/Output devices. In other words, Operating System controls the movement of information on in the Computer.

OR

An operating System is a collection of programs that manage System is to provide a basic set of computer instructions to manage the flow of information in the computer. The operating System forms the communication interface between the computer hardware, application software programs and the user.

Computer Boot Process

Post

Boot Record

Dos Kernel

Device Drivers

Config.sys

Command.com

Autoexec.Bat

Dos prompt

POST(Power - On Self Test)

Whenever we switch on a PC a program called POWER-ON SELF TEST (POST) is executed from the ROM-BIOS(BASIC INPUT OUTPUT SYSTEM).It checks the hardware of the PC step by step and if it finds any error the PC will halt with an error massage displayed on the screen. If it does not find any error, it will enable the PC for further operation.

OR

The POST(POWER- ON SELF TEST) is a firmware which is always present in ROM-BIOS of any PC and whenever the PC is switched "ON" the first program which is executed is POST. Basically POST is a series of programs which checks all the logic on the motherboard which contains the CPU and all the support chips, the base memory on the motherboard as well as on the expansion card and all the I/O devices that are connected with the PC.

If the POST find any error or malfunctioning of the hardware, it has four different methods of indicating the error.

(a) Display error massage as error code.

(b) Output the different tomes (short or long) at the speaker.

(c) Output the check points on Port A of programmable peripheral interface (PPI)

(d) Display a detailed error message.

With the help of the above error indicating methods, it becomes easy to locate and rectify the error that occurs in a PC.

BOOT RECORD

Once the POST performs the job of checking the computer and its attached devices, the control is then transferred to "BOOT RECORD". The main function of "BOOK RECORD" is to convey the following information which it requires to know to access information from disk.

1. The number of bytes per sector

2. The number of sectors per cluster, per track, per disk

3. The number of sides

4. The total number of sectors on disk

5. The maximum no. of entries that root area can hold

6. The most important part of Boot record is to find out whether the disk is bootable or not.

DOS KERNEL

From the boot record the control is then transferred to the most important phase called DOS KERNEL.. DOS KERNEL is made up of two special hidden system files namely IO.SYS and MSDOS.SYS. DOS kernel works in tandem with COMMAND.COM for interfacing the computer, the user and the programs.

IO.SYS

IO.SYS provides the basic facilities for handling the input and output (I/O device) such as keyboard and the display on your terminal screen.

MSDOS.SYS

MSDOS.SYS is the control program that runs everything OR This is a program for Application program to use it contains special subprograms to make many commonly easy for programmer.

CONFIG.SYS

The CONFIG.SYS file is a text file that contains special commands. these commands configure your computer's hardware components. so that MS-DOS and applications can use them. When MS-DOS starts, it carries out the commands in the CONFIG.SYS file. Typically, the CONFIG.SYS file is located in the root directory of current drive.

COMMAND.COM

After setting the computer to suit the user's needs, the control is then transferred to "user interface" or "command interpreter" or COMMAND.COM This lie gets loaded into memory and then takes up the role of "policeman", who is on constant vigil to help out people in trouble.

The command processor consists of four distinctly separate parts:-

(1) A RESIDENT PORTION resides on memory immediately after MSDOS.SYS & its data area. This portion contains the routines to process interrupts of

Critical error handling

Control break handling

Terminate address.

This includes displaying error messages and interpreting the reply Abort, Retry or lgnore. All the DOS error handling is done within this position of the command processor.

(2) AN INITIALIZATION PORTION follows the resident portion. This section contains the Autoexec file processor setup.

(3) THE TRANSIENT PORTION is loaded at the high end of memory which is command processor itself. It contains:-

All the internal command processors.

The batch file process.

Produces the system prompt.

Accepts the keyboard commands & causes it to be executed.

(4) THE LOADER PORTION loaded with a routine to load & execute external commands, i.e., files with the extension .COM and .EXE. This portion is at the highest end of memory and is invoked but the EXEC function called to load the program.

AUTOEXEC.BAT

An AUTOEXEC.BAT file lets you to run programs automatically when you start MS-DOS OR Some information you want to flash out when you start the computer.

HOW TO (RE)BOOT COMPUTER

(A) Set CPU button to ON.

(B) Press Reset Button.

(C) Press "CTRL+ ALT+ DEL"

Guide lines for DOS command

(1) You can type commands in uppercase or lowercase letter or a combination of both.

(2) Commands must be spelled correctly. Incorrectly spelled commands may result in a "Bad command or file name" message.

(3) A colon (:) must be included when specifying a drive letter.

(4) Commands are usually followed by one or more parameter.

(5) To abort a command, press control and c (CTRL+C) and Control and Break (CTRL+BREAK) at the same time.

(6) The DOS prompt consist of the default drive letter and the character ">" E.g.:- C:\>

(7) Commands start executing only after you press the ENTER key.

WILD CARD CHARACTERS

The wild card characters are used to restrict the scope of a DOS command to only those files which matches the pattern specified.

There are two types of wild card :- "*" & "?"

Where "*" can substitute a set of characters & "?" can only substitute a character at a particular position.

DOS COMMANDS

There are two types of DOS commands :-

1. INTERNAL COMMANDS 2. EXTERNAL COMMANDS

1. INTERNAL COMMANDS :- Internal Commands are those commands which get transferred into computer's memory. For e.g.:- DIR, COPY etc.

2. EXTERNAL COMMANDS :- External Commands are those commands which don't get transferred into computer's memory. For e.g.:- XCOPY, FORMAT etc.

INTERNAL COMMANDS

DATE

This command is used to enter or change the date known to the system

Syntax : - DATE [mm/dd/yy ]

Ex : - c:> DATE

TIME

This command is used to enter or change the time known to the system.

Syntax : - TIME [ hh : mm:[ss[.xx]]]

hh = 0 - 23

mm = 0 - 59

ss = 0 - 59

xx = 0 - 99 (hundredths of a second)

Ex. : - C:\> TIME

CLS

This command is used to clear the screen.

Syntax : - CLS

Ex. : - C:\> CLS

VOL

This command is used to see the volume label of the specified drive.

Syntax : - VOL [Drive name:]

Ex. : - C:\> VOL

VER

This command is used to see the MS - DOS version.

Syntax : - VER

Ex. : - C:\> VER

DIR

This command lists the files and the sub directories in a directory except the hidden system files.

Syntax:- DIR[drive:] [path ] [file name [.ext]] [/p] [/w] [/A] [/s]

Ex.:- C\> DIR ( display all files)

C:\> DIR NAME ( display only specified name)

C:\> DIR/P (display pause wise)

C:\> DIR/W (display width wise)

C:\> DIR/A (display files with specified attributes )

C:\> DIR/S (display all files in a directory and all subdirectory)

C:\> DIR ABC.*( display all files having name ABC)

C:\> DIR ?.*( display all files having file name one character)

MD ( MKDIR)

This command is used to creates a directory in the specified disk.

Syntax :- MD [drive:] [path ]

Ex. :- C:\> MD RAJ

CD (CHDIR)

This command changes the DOS current directory of the specified directory OR displays the working directory.

Syntax :- CD [drive:] [path]

Ex. :- C:\> CD RAJ

CD..

This command puts in the parent directory to the working directory.

Ex. :- C:\> ABC\RAJ> CD..

C:\>ABC>

CD\

This command changes the current directory of the default drive to its root directory .

Ex.:- C:\ABC\RAJ> CD\

C:\>

RD (RMDIR)

This command removes a directory from the specified disk.

Syntax :- RD [drive:][path]

Ex. :- C:\> RD RAJ

RESTRICTION:-

è Directory should be empty.

è Hidden system directories can't be removed.

REN

This command is used to changes the name of the file specified in the first parameter to the name and extension given in the second parameter.

Syntax :- REN[drive:] [path]

Ex. :- C:\> REN RAJ.BAT NISHA.BAT

DEL or ERASE

This command is used to delete or erase a specified file(s).

Syntax:-DEL [drive:] [path][p]

Ex.:- C:\>DEL RAJ.BAT

C:\> DEL*.BAT(deleted all files having extension .BAT)

C:\> DEL*.*/P

( /P option is used for confirmation before deleting each file.)

TYPE

This command displays the contents of a text file on the screen.

Syntax:-TYPE [drive:] [path]

Ex.:- C:\> TYPE RAJ.BAT

C:\>TYPE RAJ.BAT >PRN

NOTE :- If you wants to redirect the output a file, use filename instead of PRN.

COPY

This command is used to copies one or more files to another specified disks.

Syntax :- COPY [drive:] [path] [drive:]

[path]

Ex. :- C:\> COPY RAJ.BAT NISHA .BAT

C:\> COPY RAJ .BAT+ NISHA .BAT JEETU.BAT

C:\> COPY*.* A:

PATH

This command displays or sets a search path for executable files.

Syntax :- PATH [drive:] [path] ;[drive:] [path]

Ex. :- C:\> PATH A\;C:\

NOTE:-Type PATH; to clear all search- path settings and direct MS-DOS to search only in the current directory.

Type PATH without parameters to display the current path.

PROMPT

This command set a new MS-DOS prompt.

Syntax:- PROMPT "prompt string"

Prompt can be made up of normal characters and the following special codes

$Q --> =(equal sign)

$$ --> $ (dollar sign)

$T --> Current time

$D --> Current date

$P --> Current drive and path

$V--> MS-DOS version number

$N -->Current drive

$G --> > ( greater -then sign)

$L --> < (less- than sign)

Type PROMPT without parameters to reset prompt to the default setting.

EXTERNAL COMMANDS

DOS KEY

This command is loads the DOSKEY program into memory. The DOSKEY program recalls MS- DOS commands and enables you to edit command lines.

Syntax :- DOSKEY

Ex :- C:\> DOSKEY

NOTE :- F7 key is used to display all command into the computer memory. F9 issued to select a line number. ALT+ F7 key is used to remove all the previous used command from its memory.

DELTREE

This command deletes a directory and all the files and subdirectories that are in it.

Syntax :- DELTREE [drive:] [path]

name>or name>

Ex. :- C:\>DELTREE RAJ

MOVE

This command moves one or more files to the location specify . It can also be used to rename files and directories.

Syntax :- MOVE [drive:] [path]

Ex. :- C:\> MOVE RAJ. BAT NISHA.BAT

SCANDISK

This command detects, diagnoses and repairs disk errors. It can repair both our file system (FAT) and physical disk, i.e. cross linked files, lost clusters, surface flaws etc. This is more useful than CHKDSK command.

Syntax :- SCANDISK [drive name:]

Ex :- C:\>SCANDISK A:

EDIT

This command starts MS-DOS editor, a text editor you can use to creates and change ASCII text files.

Syntax :- EDIT [drive:] [path]

Ex :- EDIT AUTOEXEC.BAT

NOTE:- After using this command we get following MENUS:-

FILE

EDIT

SEARCH

OPTION

HELP

If you want to activate menu for doing the various types of job we have to select first character of that menu with ALT key.

DISKCOPY

This command copies the contents of the diskette in the source drive to the diskette in the target diskette is unformatted, during the copy the disk is formatted.

Syntax :- DISKCOPY

Ex. :- C:\> DISKCOPY A: B:

DISKCOMP

This command is used to compares the contents of two floppy disks

Syntax :- DISKCOMP

Ex :- C:\> DISKCOMP A:B

XCOPY

This command copies files, directories and their subdirectories.

Syntax :- XCOPY [drive:] [/P] [/S] [/E]

Ex. :- C:\> XCOPY A *.*/S/E

C:\> XCOPY A *.*/P

NOTE :- /S --> switches used to copies directories and lower level subdirectories unless they are empty.

/P --> switches prompts you before copying each file to you let confirm whether you want to create each target file.

/E--> switches copies any subdirectories even if they are empty.

FORMAT

This command formats a specified desk. Formatting analyzes the entire desk for any defective tracks. This command is also used to format all new desk before MS- DOS can use them.

Syntax :- FORMAT [drive:] [/S] [/4] [/U] [/Q] [/C]

Ex. :- C:\> FORMAT A /S/C/U

NOTE:- /S--> This option is used to copy the operating system files.

/4 --> This option is used to format a low density( DSDD) in a

high density (1.2 MB) drive.

/U --> This option is used to unformatting unsave.

/Q --> This option is used to quick formatting.

/C --> This option is used to correct the bad clusters.

SYS

This command creates a startup desk by copying hidden MS-DOS system files and the MS-DOS command interpreter (COMMAND.COM) to the disk.

Syntax :- SYS <>

Ex. :- C:\> SYS A:

LABEL

This command creates, change or delete the volume identification label on a desk.

Syntax :- LABEL [drive:] [volume label]

Ex :- C:\>LABEL A:AKSHAT

TREE

This command graphically displays the structure of a directory.

Syntax :- TREE [drive name:] [/F]

Ex :- C:\>TREE A : RAJ/F

NOTE:- /F option lists the full path of each directory and subdirectory on the specified drive.

ATTRIB

This command sets or resets the file attributes for a single file, for selected files in a directory or for all files in a directory level . It also display the attributes of a file.

Syntax :- ATTRIB [+R] [-R] [H][-H] [+A] [-A] [path]

Ex. :- ATTRIB +H RAJ.BAT

NOTE:- +H --> change specified file(s) to hidden.

-H --> makes hidden file(s) visible again.

+R --> change specifies file(s) to read only.

-R --> change specifies file(s) to write only.

+A --> sets the archive attribute of a file.

-A --> clear the archive bit of the specified file.

CHKDSK

This command is used to checks the status of a disk and displays a status report. Can also fix disk errors.

Syntax :- CHKDSK [drive:] [/F] [/V]

Ex. :- C:\>CHKDSK A /F/V

NOTE :- /F --> This option direct CHKDSK to fix errors found in a directory of FAT (File Allocation Table)

/V --> This option display the name of each file in every directory as a desk is checked.

WARNING:- Do not use CHKDSK with the /F switch when you are running windows.

UNFORMAT

This command is used to recover files from an accidental desk format.

Syntax :- UNFORMAT [drive name:]

Ex :- C:\>UNFORMAT A:

UNDELETE

This command is used to restores files that where previously deleted by using the DEL command.

Syntax :- UNDELETE [[drive:] [path] file name]

Ex. :- C:\> UNDELETE RAJ.BAT

MODE

This command sets operation modes for devices.

Syntax :- MODE n

Ex. :- C:\> MODE CO80

Where "n" specified one of the following values 40, 80, CO40, CO80, MONO.

NOTE :- 40 --> indicate 40 characters per line.

80--> indicate 80 characters per line.

MONO --> specified a monochrome display adapter with a

constant display width of 80 characters per line.

MORE

This command that reads data from the standard input device, sends one screen of data to the standard output device and then pause with the message ---MORE---

Syntax :- MORE

NOTE :- The MORE command will not work if the disk is full or write protected because to hold input information until it is displayed. This command viewing long files.

Ex. :- C:\> TYPE RAJ.BAT MORE

C:\> MORE

When the screen is full, the message ---MORE--- appears on the bottom line, press any key to see the next screen.

FIND

This command is used to searches a files, several files, or piped input for a string.

Syntax :- FIND [/V] [/C] [/N] [I] "string" [drive:] [path ]

<>

Ex. :- C:\> FIND /C "TEXT" RAJ. BAT

NOTE:-

/V Displays all lines NOT containing the specified string.

/C Displays only the count of lines containing the string, but does

not display the lines also.

/N Displays line numbers with the displayed lines.

/I Ignores the case of characters when searching for the string.

“string” Specifies the text string to find.

[drive:][path]filename

Specifies a file or files to search.

If a pathname is not specified, FIND searches the text typed at the prompt or piped from another command.

SORT

Sorts input and writes results to the screen, a file, or another device

SORT [/R] [/+n] [[drive1:][path1]filename1]

[> [drive2:][path2]filename2] [command ]

SORT [/R] [/+n] [> [drive2:][path2]filename2]

/R Reverses the sort order; that is, sorts Z to A, then 9 to 0.

/+n Sorts the file according to characters in column n.

[drive1:][path1]filename1 Specifies file(s) to be sorted

[drive2:][path2]filename2 Specifies a file where the sorted input is to be stored.

command Specifies a command whose output is to be sorted.

SETVER

This command causes DOS to supply a different version number to an application. It updates a table of application that require DOS to provide an earlier version number. We must load this table into memory by including the Command :

DEVICE = SETVER.EXE in your CONFIG.SYS file.

Syntax : SETVER

[/D or Delete]

Example : C:\>SETVER OLDGAME.EXE 3.3

C:\>SETVER/D OLDGAME.EXE

BACKUP

Both MSBACKUP (Backup for DOS) and Backup for Windows are used to copy your files to one or more backup diskettes for safekeeping. In this way, if you experience a disk drive failure or data error, you can restore your files from the backup media.

When we run backup first time, then we are prompted to perform a compatibility test. This ensures that Backup is setup properly for your computer.

RESTORE

This command restored files back to a fixed disk after they have been copied to floppy disks using BACKUP. This command available from DOS versions 2.00 through 5.00. Later versions of DOS include its own restore utility. Windows also uses same command.

Additional Knowledge of DOS

BATCH FILE

Batch files are ASCII text files that store a series of commands that are later automatically executed line-by-line when you run the file. It’s Extension should always be .BAT. A batch file may include following elements :-

DOS commands

Program names

Batch language commands

Command line and environmental variables

Different commands used in a Batch file are :-

1. @ - Turns off the display of command followed by @.

2. Echo - Turns off or on all the commands to display on screen after using it.

3. Pause - Prompts to strike any key to continue...

4. Call - Runs a second batch file and returns to the batch file from which it was called.

5. Goto

6. <:Labelname> - Label is used to give a specific name to a line of batch file.

7. %0 - %9 - Lets you substitute from one to ten character strings in a batch file command line.

Suppose that we have created a file named REPORT.BAT :-

C:\>COPY CON REPORT.BAT

@ECHO OFF

GOTO %1

:SALE

TYPE SALE.TXT

GOTO END

:BUY

TYPE BUY.TXT

GOTO END

:MARKET

TYPE MARKET.TXT

:END ^Z

1 File(s) Copied.

C:\>REPORT <SALE>

Now when we type any string followed with REPORT then %1 will be replaced with that string and then labeled set of command will be executed.

8. IF - This command is used to compare two different objects. These comparison

may be of three types :-

(a) Checking about existing of a file

(b) Comparison between two words, whether they are equal or not

(c) To know about ErrorLevel

(A) IF [NOT] EXIST COMMAND - This command checks the existance of a file and if returns True then execute command of the same line, otherwise control will be transferred to next line.

@ECHO OFF

IF EXIST %1 GOTO YES

ECHO %1 FILE DOES NOT EXIST

GOTO END

:YES

ECHO %1 FILE EXIST

:END

(B) IF [NOT] == - This command compares two text strings and execute same line’s command if the both is same, otherwise control will be transferred to next line.

@ECHO OFF

IF .%1 == .GOTO Errmsg

ECHO You have typed %1

GOTO end

:Errmsg

ECHO Please type a parameter

:End

Save this file with IFF.Bat.

C:\> Iff abc.txt

This command line replace %1 with abc.txt, so .abc.txt will not be same as . (i.e. no any parameter), so condition become false and next line will be executed, i.e. “You have typed abc.txt”.

C:\>Iff

This command line have no any second parameter, so now %1 will not have any value and .==. will become true so control will be transferred to :Errmsg and we will get “Please type a parameter”.

(C) IF [NOT] ERRORLEVEL == - When we run any program then after completing its execution, it returns a code to OS, who tells OS that whether the program executed successfully or not. If any error had been appeared during the execution then what was it. DOS stored this code in a variable “ErrorLevel”. So, through this variable, if used with “IF” command, we can know about the error.

Exit code Description

4 Lack of Memory

3 Fatal Error

2 Ctrl + C was pressed during the execution

1 Non Fatal Error

0 Program Executed successfully.

@ECHO OFF

XCOPY FF.BAT TEMP

IF ERRORLEVEL 4 GOTO MEM

IF ERRORLEVEL 3 GOTO DISKERR

IF ERRORLEVEL 2 GOTO BREAK

IF ERRORLEVEL 1 GOTO NON

IF ERRORLEVEL 0 GOTO OK

:OK

PAUSE

ECHO COPY COMPLETED

GOTO END

:NON

PAUSE

ECHO A NON FATAL ERROR APPEARED!

GOTO END

:BREAK

PAUSE

ECHO CTRL + C WAS PRESSED

GOTO END

:DISKERR

PAUSE

ECHO FATAL DISK ERROR APPEARED

GOTO END

:MEM

PAUSE

ECHO NOT ENOUGH MEMORY

GOTO END

:END

ECHO BYE!

9. CHOICE - Waits for the user to choose one of a set of choices.

CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text]

/C[:]choices Specifies allowable keys. Default is YN

/N Do not display choices and ? at end of prompt string.

/S Treat choice keys as case sensitive.

/T[:]c,nn Default choice to c after nn seconds

text Prompt string to display

ERRORLEVEL is set to offset of key user presses in choices.

10. FOR - Runs a specified command for each file in a set of files.

FOR %variable IN (set) DO command [command-parameters]

%variable Specifies a replaceable parameter.

(set) Specifies a set of one or more files. Wildcards may

be used.

command Specifies the command to carry out for each file.

command-parameters

Specifies parameters or switches for the specified command. To use the FOR command in a batch program, specify %%variable instead of %variable.

11. REM - This command is used to give comment line in batch file.

Rem Developed by Rajeev Ranjan Kumar

CONFIG.SYS (SYSTEM CONFIGURATION COMMANDS)

In order to make the computer system work efficiently, the DOS contains certain system configuration commands. These are described below :

1. FILES - Sets the maximum allowed number of simultaneously opened files. The syntax is :

FILES = n

The n parameter indicates the maximum number of concurrently open files. Default value is 8; maximum numbers is 255. If you exceed the maximum number of open files during processing, DOS displays the message "Too many files are open".

Example : FILES = 60

Ø Each increment to this parameter decreases the amount of RAM available to application by 128 bytes. Therefore it serves no purpose to set this parameter any higher than the maximum possible number of files for our application.

2. BUFFERS - A buffer is an area of memory set aside for temporary data storage. Buffers can speed up system performance by reducing the number of times DOS must directly access the disk. However, each Buffer takes up about 530 bytes of RAM reducing the amount of memory available for processing. Too many buffers will slow down the system. Buffers command is used to sets the number of disk-read buffers.

Buffers = n (n may be 1 to 99)

where n is the number of the buffers to be used by DOS.

3. COUNTRY - This command is used to start our system with a non United States keyboard and display character set.

Syntax : COUNTRY = CODE, PAGE, DRIVE:\PATH\COUNTRY.SYS

Example : COUNTRY = 044,, C:\DOS\COUNTRY.SYS

Where 044 is the code for united kingdom, second comma is used to use the default page and after it location of Country.Sys file is defined. Default country code is 001 of United State.

4. DEVICE - Different devices of our system requires some additional files to work properly. To do so we have to install and give accurate locations of that files and also it should be mentioned in booting process. DEVICE command is used to state the location of this type of file and because it is mentioned in CONFIG.SYS file, so automatically at the time of booting all the Device drivers are loaded.

Example : Device = C:\MOUSE\MOUSE.DRV


Microsoft(R) Windows DOS

(C)Copyright Microsoft Corp 1990-2001.

ASSOC- Displays or modifies file extension associations.

ATTRIB- Displays or changes file attributes.

BREAK- Sets or clears extended CTRL+C checking.

BCDEDIT- Sets properties in boot database to control boot loading.

CACLS- Displays or modifies access control lists (ACLs) of files.

CALL- Calls one batch program from another.

CD- Displays the name of or changes the current directory.

CHCP- Displays or sets the active code page number.

CHDIR- Displays the name of or changes the current directory.

CHKDSK- Checks a disk and displays a status report.

CHKNTFS- Displays or modifies the checking of disk at boot time.

CLS- Clears the screen.

CMD- Starts a new instance of the Windows command interpreter.

COLOR- Sets the default console foreground and background colors.

COMP- Compares the contents of two files or sets of files.

COMPACT- Displays or alters the compression of files on NTFS partitions.

CONVERT- Converts FAT volumes to NTFS. You cannot convert the current drive.

COPY- Copies one or more files to another location.

DATE- Displays or sets the date.

DEL- Deletes one or more files.

DIR- Displays a list of files and subdirectories in a directory.

DISKCOMP- Compares the contents of two floppy disks.

DISKCOPY- Copies the contents of one floppy disk to another.

DISKPART- Displays or configures Disk Partition properties.

DOSKEY- Edits command lines, recalls Windows commands, and creates macros.

DRIVERQUERY- Displays current device driver status and properties.

ECHO- Displays messages, or turns command echoing on or off.

ENDLOCAL- Ends localization of environment changes in a batch file.

ERASE- Deletes one or more files.

EXIT- Quits the CMD.EXE program (command interpreter).

FC- Compares two files or sets of files, and displays the differences between them.

FIND- Searches for a text string in a file or files.

FINDSTR- Searches for strings in files.

FOR- Runs a specified command for each file in a set of files.

FORMAT- Formats a disk for use with Windows.

FSUTIL- Displays or configures the file system properties.

FTYPE- Displays or modifies file types used in file extension associations.

GOTO- Directs the Windows command interpreter to a labeled line in a batch program.

GPRESULT- Displays Group Policy information for machine or user.

GRAFTABL- Enables Windows to display an extended character set in graphics mode.

HELP- Provides Help information for Windows commands.

ICACLS- Display, modify, backup, or restore ACL’s for files and directories.

IF- Performs conditional processing in batch programs.

LABEL- Creates, changes, or deletes the volume label of a disk.


MD- Creates a directory.

MKDIR- Creates a directory.

MKLINK- Creates Symbolic Links and Hard Links

MODE- Configures a system device.

MORE- Displays output one screen at a time.

MOVE- Moves one or more files from one directory to another directory.

OPENFILES- Displays files opened by remote users for a file share.

PATH- Displays or sets a search path for executable files.

PAUSE- Suspends processing of a batch file and displays a message.

POPD- Restores the previous value of the current directory saved by PUSHD.

PRINT- Prints a text file.

PROMPT- Changes the Windows command prompt.

PUSHD- Saves the current directory then changes it.

RD- Removes a directory.

RECOVER- Recovers readable information from a bad or defective disk.

REM- Records comments (remarks) in batch files or CONFIG.SYS.

REN- Renames a file or files.

RENAME- Renames a file or files.

REPLACE- Replaces files.

RMDIR- Removes a directory.

ROBOCOPY- Advanced utility to copy files and directory trees

SET- Displays, sets, or removes Windows environment variables.

SETLOCAL- Begins localization of environment changes in a batch file.

SC- Displays or configures services (background processes).

SCHTASKS- Schedules commands and programs to run on a computer.

SHIFT- Shifts the position of replaceable parameters in batch files.

SHUTDOWN- Allows proper local or remote shutdown of machine.

SORT- Sorts input.

START- Starts a separate window to run a specified program or command.

SUBST- Associates a path with a drive letter.

SYSTEMINFO- Displays machine specific properties and configuration.

TASKLIST- Displays all currently running tasks including services.

TASKKILL- Kill or stop a running process or application.

TIME- Displays or sets the system time.

TITLE- Sets the window title for a CMD.EXE session.

TREE- Graphically displays the directory structure of a drive or path.

TYPE- Displays the contents of a text file.

VER- Displays the Windows version.

VERIFY- Tells Windows whether to verify that your files are written correctly to a disk.

VOL- Displays a disk volume label and serial number.

XCOPY- Copies files and directory trees.

WMIC- Displays WMI information inside interactive command shell.


1. In MS-Dos 6.22, which part identifies the product uniquely
a. MS b. DOS c. Ms-DOS d. 6.22

Answer: d. :- MS stands for Microsoft, DOS is the name of operating system Disk Operating System, 6.22 is the version number that identifies the product.

2. In Ms-Dos what command you will use to display system date?

a. Date command b. Ver command c. Disk command d. Format command

Answer: a. :- Ver command displays the version number of Dos. There is no command as Disk. Format command prepares a disk to be used with DOS. Thus Date is the command that lets you to display and/or change the system date.

3. While working with Ms-Dos which command transfers a specific file from one disk to another?

a. Copy b. Diskcopy c. Time d. Rename

Answer: a. :- For a specific file to copy from one disk to another disk, Copy command should be used. Diskcopy copies whole disk into new disk. Time command is to display system time and Rename command just changes the name of a file.

4. If you don’t know the current time, which command will you use to display

a. Copy b. Ver c. Time d. Format

Answer: c. :- Time command displays and allows you to change system time. TIME only displays the system time and TIME

5. Which command divides the surface of the blank disk into sectors and assign a unique address to each one

a. Ver b. Format c. Fat d. Chkdsk

Answer: b. :- Ver is used to display the version number of DOS in use. Fat command does not exist and Chkdsk is to check disk errors and fix it. Thus dividing surface into sectors is done by Format command.

6. Each time you turn on your computer, it will check on the control file

a. Command.com, io.sys b. Command.com, date.com, dir.com

c. Command.com, io.sys, msdos.sys d. Chkdsk.exe

Answer: c.: command.com, io.sys and msdos.sys are the essential system files of MS-Dos. Loading these files from disk into memory is known as booting. Booting is the process of preparing your computer to work.

7. If you need to duplicate the entire disk, which command will you use?

a. Copy b. Diskcopy c. Chkdsk d. Format

Answer: b.: Diskcopy is used to perform track-by-track copy of a disk into another. Copy command copies selected files; chkdsk and format commands are not for copying purpose.


8. Which of the following extensions suggest that the file is a backup copy

a. Bak b. Bas c. Com d. Txt

Answer: a.: Bak extension is commonly used to store backup copies of files so that it can be restored later when original file is corrupted or deleted. Bas extension indicates the file is a BASIC program source file, com is command file and txt is plain text file.

9. Which command lists the contents of current directory of a disk

a. Copy b. Tree c. Cd d. Dir

Answer: d: Dir command lists the directory of current location. It includes the files, subdirectories and some other system information. Tree command is used to list the directory structure in tree diagram; CD command to change directory and Copy command to copy a file into another.

10.Only filenames and extensions are to be displayed in wide format, which command you’ll use?

a. Dir/w b. Dir a: c. Dir/s d. Dir/b

Answer: a: Dir/w only displays the file names and extensions excluding file created date/time, file size. Second option dir a: will list the contents of A drive (floppy drive), third dir/s lists current directory and its subdirectories too, dir/b displays bare format, that means, it just makes a list of files, no more information.

11. Which command displays all the files having the same name but different extensions?

a. Dir filename.* b. Dir filename.ext c. Dir *.sys d. Dir *.ext

Answer: a.: * is a wild card character that stands for all any character. When you specify filename.*, it meant filename should be specified one but extension can be any. Second option lists only the specified filename.exe and third and fourth commands lists all files with sys extension and specified extension.

12. Which command displays only file and directory names without size, date and time information?

a. Dir/w b. Dir a: c. Dir /b d. Dir /s

Answer: c: dir/b command barely lists the names of files and directories without any other information like size, date, time etc.

13. Which command displays comma for thousand separating on file size while listing?

a. Dir/w b. Dir/s c. Dir/b d. Dir/c

Answer: d.: Using comma for separating thousand in file size is by default on. You can use dir/-c to remove comma from the listing. /C stands for comma.

14. Which command is used to display all the files having the (.exe) extension but different filename?

a. Dir filename.* b. Dir filename.ext c. Dir *.sys d. Dir *.ext

Answer: d.: First two options are obviously wrong since specifying filename will list for that filename only. Since we need to list only with .ext extension fourth option is correct. Third option displays all files with sys extension.

15. Which command should be used to display all files within the specified subordinate directory of the subdirectory?

a. Dir \ pathname b. Dir \ pathname\pathname

c. Dir / ch d. Dir \pathname\filename

Answer: b.: The subordinate directory of subdirectory can be accessed through the path sequence pathname\pathname and dir command lists the files of that location.

16. Which command displays the directory list including files in tree structure?

a. Dir/s/f b. Tree/f c. Tree/s/f d. Dir/f

Answer: b.: Tree command lists the directory structure in tree structure and /f switch of tree command includes the filenames in the structure.

17. Which command will be used to display a file within the specified directory of pathname?

a. Dir \pathname b. Dir \pathname\pathname

c. Dir/ch d. Dir \pathname\filename

Answer: d.: Displaying a file which is inside specified directory can be done by specifying a directory name \ and filename.

18. Which command creates a directory or subdirectory?

a. Dir b. Mkdir c. Md d. Both b and c

Answer: d.: MK command and MKDIR both commands are equivalent and can be used to create subdirectories. Dir only lists directory but can’t create.

19. Which command displays current directory name or change from one to another?

a. Chdir b. Cd c. Mkdir d. Both a and b

Answer: d.: CD and CHDIR commands are equivalent and both used to change current working directory to another one. MKDIR creates a new directory and can’t be used to change.

20.Which command is used to delete the directory that is empty?

a. Del *.* b. RD c. Erase d. MD

Answer: b.: RD command or RMDIR commands can be used to remove a directory if it is empty. Del command and Erase commands are used to delete files not directories. MD creates a new directory and can’t remove directory.

1. An entire path name, consisting of several sub-directory names can contain up to

a. 13 character b. 36 character c. 63 character d. 53 characters

Answer: c

2. In which year the first operating system was developed

a. 1910 b. 1940 c. 1950 d. 1980

Answer: c

3. MS-DOS developed in

a. 1991 b. 1984 c. 1971 d. 1961

Answer: b

4. Maximum length of DOS command using any optional parameter is

a. 26 characters b. 87 characters c. 127 characters d. None of above

Answer: c

5. In which version of DOS. CHKDSK command has been changed to SCANDISK?

a. 5.0 b. 6.2 c. 6.0 d. 6.2

Answer: d



6. CHKDSK command is used to

a. Analyze the hard disk error b. Diagnose the hard disk error

c. Report the status of files on disk d. All of the above

Answer: d

7. Which file is the batch file that is read while booting a computer?

a. Autoexec.bat b. Auto-batch c. Autoexecutive.bat d. Auto.bat

Answer: a

8. Which command is used to backup in DOS 6+ Version

a. BACKUP b. MSBACKUP c. MSBACKEDUP d. All of the above

Answer: b

9. Copy and Xcopy are same in the sense

a. Both are internal command of DOS b. Both are external commands of DOS

c. Both can be used to copy file or group of files d. Both a and b

Answer: c

44. Which command be used to clear the screen and display the operating system prompt on the first line of the display?

a. Cd b. Md c. Rename d. cls

Answer: d

10. Which command is used to clear the screen

a. Cls b. Clear c. Clscreen d. All of above

Answer: a

11. internal command in Dos are

a. Cls, rd label b. Dir, ren, sys c. Time, type, dir d. Del, disk copy, label

Answer: c

12. Which command is used to copy files?

a. Copy b. Diskcopy c. Type d. All of the above

Answer: a

13. To copy the hidden system files of DOS to another disk you can use the command

a. Copy b. Ren c. Sys d. Diskcopy

Answer: c

14. Disk copy command in DOS is used to

a. Copy a file b. Copy contents of one floppy disk to another

c. Copy contents of CD-ROM to another d. All of the above

Answer: b

15. SYS command is used to

a. Copy DOS system files to new disk b. Copy DOS configuration files to a new disk

c. Update the DOS system files d. None of above

Answer: a

16. The command used to copy a file named temp.doc from drive C: to drive A: is

a. Copy temp.doc to a: b. Copy c:\temp.doc a: c. Copy c: a: d. Copy temp a: c:

Answer: b

17. External command in DOS are

a. Copy, edit, sys, format b. Edit, sys, chkdsk

c. Chkdsk, prompt, date d. Sys, ver, vol

Answer: b

18. Which keys can be pressed quit without saving in DOS

a. Ctrl + A b. Ctrl + B c. Ctrl + C d. Ctrl + D

Correct Answer: c

19. Which command is used to get the current date only?

a. Date b. Time c. Second d. All of the above

Answer: a

20. Generally, the DATE is entered in the form

a. DD-YY-MM b. YY-DD-MM c. MM-YY-DD d. MM-DD-YY

Answer: d

21. DEL command is used to

a. Delete files b. Delete directory c. Delete labels d. Delete contents of file

Answer: a

22. Which command be used to ask you to confirm that you want to delete the directory?

a. Deltree b. Deltree/f c. Del *.*/p d. Erase *.*

Answer: c

23. Which statement is correct?

a. Directories can be kept inside a file b. Files can not be kept inside a directory

c. 1 millisec = 10 ^ 3 sec d. None of above

Answer: c

24. CHKDSK can be used to find

a. Disk’s bad portion b. Occupied space c. Free space d. All of above

Answer: d

25. DIR command is used to

a. Display a list of files in a directory b. Display contents of files in directory

c. Display type of files in a sub directory d. All of above

Answer: a

26. The deleted file in MS-DOS can be recovered if you use the command mention below immediately, the command is:

a. DO NOT DELETE b. NO DELETE c. UNDELETE d. ONDELETE

Answer: c

27 To copy the file command.com from drive c: to drive a:

a. Drive c: copy drive a:\command.com b. C:A: copy command.com

c. Copy c:\command.com a: d. Both b and c

Answer: c

28. While working with MS-DOS which key is used to get the previous command used:

a. F3 b. F1 c. F6 d. F9

Answer: a

29. FAT stands for

a. File Accomodation Table b. File Access Tape

c. File Allocation Table d. File Activity Table

Answer: c

30. xcopy command can copy

a. individual files or group of files b. directories including subdirectories

c. to diskette of a different capacity d. all of above

Answer: d

31. Which command is used to make a new directory?

a. Md b. Cd c. Rd d. None of above

Answer: a

32. Full form of MS-DOS is

a. Micro System Disk Operating System b. Micro Simple Disk Operating System

c. Micro Soft Disk Operating System d. Micro Sort Disk Operating System

Answer: c

33. Operating System is like a

a. Parliament b. Secretary c. Government d. None of the above

Answer: c

34. Format command is used to

a. Prepare a blank disk b. Create a new blank disk from a used one

c. Both of above d. None of above

Answer: c

35. The following command set is correct according to their function

a. RD can MD b. DEL and ERASE c. CD and RD d. COPY and RENAME

Answer: b

36. Which command is used to change the file name?

a. Ren b. Rename c. Both of above d. None of above

Answer: c

37. While working with MS-DOS, which command is used to copying the files to transfer from one PC to another one?

a. Rename b. Path c. Dir d. Copy

Answer: d

38. RESTORE command is used to

a. Restore files from disks made using the BACKUP command

b. Restore files which are deleted c. Restore files from recycle bin

d. Restore files which are deleted recently

Answer: a

39. The vol command is used to

a. see the value of list b. see the veriety of language

c. see the disk volume label d. see the volume of largest

Answer: c

40. In MS-DOS you can use small or capital letter of combination of both to enter a command but internally MS-DOS work with.

a. Small letter b. Capital letter c. Both a and b d. None of above

Answer: b

41. The maximum length in DOS commands is

a. 80 chars b. 127 chars c. 100 chars d. 8 chars

Answer: b

42. The time command is used to display _____ time.

a. US time b. Greenwich Mean Time c. Julian Time d. System Time

Answer: d


No comments:

Post a Comment