ms dos tutorial

21

Click here to load reader

Upload: ehtisham-ali

Post on 16-Apr-2017

3.412 views

Category:

Education


3 download

TRANSCRIPT

Page 1: Ms dos tutorial

MS-DOS

START

TUTORIALCreated By

EHTISHAM ALI

Page 2: Ms dos tutorial

How to start MS-DOS

Important Tips

DOS Commands - Quick Review

Choose one of the following options:

Exit Tutorial

Page 3: Ms dos tutorial

Starting MS-DOS

Press [win+r] from your keyboard to pop-up Run window. Type [cmd] and press [Enter] Now a command prompt window will appear.

Main Menu X

Page 4: Ms dos tutorial

Important Tips

In command prompt by default your are in system root drive (c:\) with user account.for example C:\Documents And Settings\

There are two types of commands External and Internal generally we use Internal commands.

By default your active drive is C, any command you enter is for active drive.

To have general help in command prompt type help and press enter or to get help for a specific command type the name of command added with /?

for example tree/?

To repeat a command press upward arrow from keyboard.

To stop any processing command press Ctrl+C.

To copy any information displayed in command prompt go to the top left corner of command prompt window and while clicking on it you get a menu, from there select Edit then Mark.

Now highlight the area of text you want to copy and press Enter. After pressing Enter your selected text has been stored to clipboard. Now

open any word processor or simply notepad and paste copied data here(Ctrl+V) Show Images

Commands are always same whether you type in uppercase or lowercase.

Press Alt+Enter to run command prompt in full screen.

Main Menu X

Page 5: Ms dos tutorial

DOS Commands

Use all commands at your own risk. Only some basic and frequently used commands are listed here. Explanation and syntax of some commands is modified to make it simpler for non IT students.

ATTRIB CHKDSK DATE EDIT FORMAT HELP LABEL MD TIMECLS DEFRAG EXIT TREE

COPY DELDIR

Click a command to view its usage and examples.

Main Menu X

All commands are tested on windowXP sp2 with MS-DOS version 5.1.2600

Page 6: Ms dos tutorial

ATTRIBChanges or displays the attributes of a file.

SYNTAXattrib drive:\path\file(with file extension) /switches

SWITCHES+R Changes specified file to read-only, which means the file cannot be overwritten or erased

-R Changes specified file to read-write, which means the file may be overwritten or erased

+A Changes file setting to archived.

-A Changes file setting to not archived.

+H Changes specified file to hidden, which means the file will not be visible in explorer.

-H Makes hidden files visible again.

+S Marks specified file as system files (super hidden).

-S Removes system attributes from file.

EXAMPLEattrib d:\music\rehman.mp3 +s +h

attrib e:\bollywallpapers\hotkatrina.jpg +r -h +a

BACK to Command List XOpen MS-

DOS

Page 7: Ms dos tutorial

CHKDSKAnalyzes, diagnoses, and optionally corrects common hard-disk errors.

SYNTAXchkdsk drive: /switches

SWITCHES/f Enables auto-correction mechanism. When lost clusters are found.

EXAMPLEchkdsk c: /f

chkdsk d:

XBACK to Command List

Open MS-DOS

Page 8: Ms dos tutorial

CLSClears the dos screen.

SYNTAXcls

SWITCHES

BACK to Command List X

There are no switches for this command.

Open MS-DOS

Page 9: Ms dos tutorial

COPYCopies and hence can overwrite files.

SYNTAXCopy sourcedrive:\path\file targetdrive:\path /switches

SWITCHES/y Forces overwriting of existing files with same name, without prompting you to overwrite.

/-y Force DOS to prompt for conformation before overwriting existing files.

EXAMPLEcopy h:\music\airtel.mp3 d:\ringtone\ /y

copies airtel.mp3 from music folder in H drive to ringtone folder in D drive without asking you to overwrite if it already exist there.

BACK to Command List X

copy h:\music\airtel.mp3 d:\ringtone\ /-y

copies airtel.mp3 from music folder in H drive to ringtone folder in D drive. It will prompt you for confirmation to overwrite existing file.

Open MS-DOS

Page 10: Ms dos tutorial

DATEDisplays the current date and prompts you to enter another. To leave the date unchanged, press Enter.

SYNTAXdate

SWITCHES

EXAMPLE

Date

Displays the current date and prompts you enter new.

BACK to Command List X

This command have no switches.

Open MS-DOS

Page 11: Ms dos tutorial

DEFRAGSpeeds up disk performance by reorganizing fragmented files.

SYNTAXdefrag sourcedrive: /switches

SWITCHES-f Forces defragmentation

-a Analyze only

EXAMPLEdefrag h: -a

Only analyze H drive if there exists any fragmented files.

BACK to Command List X

defrag h: -f

Force defragmentation on H drive.

Open MS-DOS

Page 12: Ms dos tutorial

DELThis command can erase or overwrite your files.

Delete FilesSYNTAX

del sourcedrive:\path\file

SWITCHES

EXAMPLE

del h:\music\airtel.mp3

deletes airtel.mp3 from music folder in H drive to

BACK to Command List X

This command do not have any switches.

Use this command cautiously

Open MS-DOS

Page 13: Ms dos tutorial

DIRDisplays a list of files and directories(folders) stored in a drive.

SYNTAXdir sourcedrive:\path /switches

SWITCHES/a:d Displays all folders stored in the drive or path specified.

/a:h Displays all hidden files and folders stored in the drive or path specified.

/s Displays all folders with files contained in them in a sorted manner

EXAMPLEdir h:\music

Shows all files and folders stored in music folder on H drive

BACK to Command List X

dir h:\music /a:d

Shows only folders stored in music folder on H drive

dir h:\music /a:h

Shows all hidden files and folders stored in music folder on H drive

dir h:\music /s

Shows all folders (in music folder on H drive) with files contained in them in a sorted manner

Open MS-DOS

Page 14: Ms dos tutorial

EDITIt is a simple text editor for MS-DOS

It can also open a text file from specified location for editing. (images)

SYNTAXedit sourcedrive:\path\file

SWITCHES

EXAMPLEedit

opens the editor window.

BACK to Command List X

This command do not have any switches.

edit h:\music\ali.txt

opens the editor window with the file ali.txt stored in music folder of H drive.

Open MS-DOS

Page 15: Ms dos tutorial

EXITIt simply brings you out of the command prompt.

Exits MS-DOS

SYNTAXexit

BACK to Command List XOpen MS-

DOS

Page 16: Ms dos tutorial

FORMATThis command can format your whole drive with a new file system.

SYNTAXformat sourcedrive: /switches

SWITCHES

EXAMPLE

format h: /fs:ntfs /v:misc /x

formats H drive by ntfs file system with new volume label as misc

BACK to Command List X

Use this command cautiously

/fs: Specify file system ntfs, fat or fat32.

/v: Specify new volume label.

/x Forces volume to dismount first if necessary. all opened handles to that volume will be inaccessible.

Open MS-DOS

Page 17: Ms dos tutorial

HELPDisplays help for various commands in MS-DOS.

SYNTAXhelp

SWITCHES

BACK to Command List X

There are no switches for this command.

Open MS-DOS

Page 18: Ms dos tutorial

LABELAdds or modifies a disk volume label.

SYNTAXlabel sourcedrive:

SWITCHES

BACK to Command List X

There are no switches for this command.

Open MS-DOS

EXAMPLE

label H:misc

This will change volume label of H drive to misc.

Page 19: Ms dos tutorial

MDCreates a new folder at specified path.

SYNTAXmd sourcedrive:\path

SWITCHES

BACK to Command List X

There are no switches for this command.

Open MS-DOS

EXAMPLE

md H:\music\ali_new

This will create a new folder in music folder of H drive by the name ali_new

Page 20: Ms dos tutorial

TIMEDisplay and allow changes to the system time.

SYNTAXtime

SWITCHES

BACK to Command List X

There are no switches for this command.

Open MS-DOS

EXAMPLE

time

This will display the current time and prompt you to enter new time.

If you do not want to change simply press Enter.

Page 21: Ms dos tutorial

TREEDisplay the file-folder structure of the drive or folder specified.

SYNTAXtree sourcedrive: /switches

SWITCHES

BACK to Command List XOpen MS-

DOS

EXAMPLE

tree h:

displays all folders with there subfolders of H drive.

/f Includes the filenames in each subfolder.

tree h: /f

displays all folders with there subfolders and files contained in them of H drive.