Sunteți pe pagina 1din 16

Contents

Batch processing.............................................................................13
How to create a filename.........................................................13
The Autoexec.bat file..............................................................13
Introduction to DOS.........................................................................2 How to create an Autoexec.bat file.........................................14

Terms you should know:..................................................................2 New ways to do familiar tasks.......................................................14

Program.....................................................................................2 MS-DOS overview...........................................................................14


Files...........................................................................................2
How to give file name?.............................................................2 New ways to do familiar tasks.......................................................14
Directory...................................................................................2
Volume Label............................................................................2
Disk Drive.................................................................................2
Drive Name/Default Drive........................................................2
Command..................................................................................2
Memory.....................................................................................3

Command..........................................................................................3
Attrib [E]...................................................................................3
Chdir (cd) [I].............................................................................3
Cls [I]........................................................................................4
Copy [I].....................................................................................4
Date [I]......................................................................................4
Del [I]........................................................................................4
Deltree [E].................................................................................4
Dir [I]........................................................................................4
Diskcomp [E]............................................................................5
Diskcopy [E].............................................................................5
Exit [I].......................................................................................5
Find[E]......................................................................................5
Format [E].................................................................................5
Label [E]....................................................................................6
Mem [E]....................................................................................6
Mkdir (md) [I]...........................................................................6
More [I].....................................................................................6
Path [I].......................................................................................6
Prompt [I]..................................................................................6
Ren [I].......................................................................................8
Rmdir (rd) [I].............................................................................8
Sort [I].......................................................................................8
Start [E].....................................................................................8
Sys [E].......................................................................................8
Time [I].....................................................................................8
Type [I]......................................................................................9
Ver [I]........................................................................................9
Vol [I]........................................................................................9
Xcopy [E]..................................................................................9

Handling the disk..............................................................................9


Floppy Disks.............................................................................9

Editing the data file (Edit)..............................................................10


file Menu.................................................................................10
Edit Menu................................................................................11
Search Menu:...........................................................................11
View menu:..............................................................................11

Wild card Characters.....................................................................12

More About files and Directories ..................................................12


Multilevel Directories.............................................................12
Path and pathname..................................................................12

MS-DOS Error Message Directory...............................................12


Introduction to DOS Directory
The set of program that acts as interface Directory is the part of the disk in which we
between user and computer is called Disk can store files and sub-directories. If we suppose
Operating Systems (DOS). Mainly there are two disk a house then directory is a room of the
functions of an operating system. One is, it works house. The main purpose of creating directories is
as language translator between user and to separate files in some finite location so that we
computer and another is, it works as interface can find the file easily and quickly.
between hardware and software. It is associated
with the disk operations.
It is usually called bootstrap loader
Volume Label
because when we switch on the computer the When we use a new disk, you can put a
program reads the very first part of the system label on the outside of it to identify its contents.
diskette where DOS startup program is written, You can also give each disk an internal name
which is called Boot Reader. which is called volume Label.

Terms you should know: Disk Drive


To use the files or programs on a floppy
Program disk, you must first insert the disk into a floppy
Programs, often called application disk drive. Floppy disk drives are commonly
programs, applications, or software, are a series referred to as the A drive and the B drive. A hard
of instructions written in computer languages. disk drive, normally installed inside your
These instructions are stored in files and tell a computer, is usually referred to as the C drive.
computer to perform a task. Spreadsheets and
word processors are examples of programs. Drive Name/Default Drive
A complete drive name consists of a drive
letter and a colon. While using MS-DOS you may
Files need to type drive name. So you should know the
The collection of Data and information is default names of drives. A: and B: referred to
called files. There are two types of files i.e. floppy drive and c: and d: that usually referred to
system files and data files. Hard disk drive.
The files which operate the system Changing the default drive
(computer) are called System Files and the files, To change the default drive, type the letter
which store the simple information and data of the desired drive, followed by a colon and
given by user is called Data Files. press the ENTER key. For example, if you are
working primarily with files on drive a, it is easier
Main system files need to boot computer in to change the default drive to A, rather than
DOS: typing the letter a, followed by a colon, with
• Msdos.sys every command and filename. For example type
a: to change to floppy drive.
• Io.sys
• Command.com
Command
How to give file name? When you type MS-DOS commands, you
are asking the computer to perform tasks. For
File name contain two Part i.e. primary example, when you use the xcopy command to
name and secondary name e.g. National.txt. In copy the files of a directory, you are using a file
above example national, which is in the left of (.) named xcopy.exe, whose task is to copy the files
is called primary name and txt after (.) is called o any directory on the MS-DOS.
secondary (or extension). In case of primary There are two types of command they are
name we should not give more than 8 characters Internal command and External command
and in case of extension we should not give more
than 3 characters. And we should use 0-9 or a-z Internal Command: The commands which
in file name. If we give character like (\ / . , ) it will source file is command.com and will be loaded
be invalid. when the DOS is loaded in your computer is
called internal commands.
2
MsDOS 8/12/2009
Examples: copy con, cls, dir, date, time, type, Command
del, set etc.
Attrib [E]
External commands: The command which is
not included in the command.com file and need Syntax:
the external (separate file) is called external Attrib [±r] [±s] [±h] [±a] [drive:] pathname [/s]
command. Where +r sets the read-only attribute of a
Examples: copydisk, attrib, more, move, format, file. –R disables read-only mode. +a sets the
deltree. archive attribute of a file. –a clears the archive
attribute of a file. +h sets the hide attribute of
the file. –h clears the hide attribute of the file. +s
sets system attribute of the file and –s clears the
Memory system attribute of the file.
Memory is the place in your computer
where information is actively used. When you Description: The attrib command sets special
run a program, MS-DOS stores the program attribute to the file by which we can protect our
and files it uses in the computer’s available file from being deleted or edited. You can use
memory. There is mainly two kind of memory wildcards to specify a group of files. The
i.e. RAM (Random Access memory) ROM attributes of those files matching filename are
displayed or modified based on the switch
(Read Only Memory).
selection. Attrib doesn’t accept a directory name
How to start Dos prompt from windows as a valid filename. /s in the syntax specifies all
1. Click to (Start) button. the sub directories and path specified.
2. click to Run
3. Type command and press enter. Example: In the given example report.txt is a file
Or name and book is a directory and you are giving
1. Click to (Start) button. attributes i.e.
2. click to Program +r for read only attribute
3. click to Ms-dos prompt +s for system attribute
+h for hide attribute
+a for archive attribute

Attrib +r +s +a +h report.txt
Attrib +h book/s
Or
Attrib nmsag.txt +r +s +a +h
Attrib book/s -h
Where /s lets you give attribute to all the
sub-directories and files.
To clear the attribute
Attrib –h –s –a –r nmsag.txt

Note: Here E exist for external command and I


exist for internal command.

Chdir (cd) [I]


Syntax:
Cd [path]

Description: The chdir (cd) command changes


the working directory to the directory you specify,
or displays the working directory.

Example:
C:\cd home
Where home is a directory name.
National Microsystems) Ltdtd. 3
C:\home>cd\ (or cd..)
Here cd\ is use to exit to the root directory. Directorie file

Cls [I] Date [I]


Syntax:
Syntax:
Cls
Date [mm-dd-yy]
Description: The cls command clears your
Description: This command displays or sets the
screen, leaving only the MS-DOS prompt and
date.
cursor.
Example:
Example: you may find it more comfortable to
Date 3-9-88
work with a “Clean Slate.” If you want to start a
Where 3-7-88 is current date.
new process with a clear screen, type
Cls
Del [I]
Copy [I] Syntax:
Del [filename][/p]
Syntax:
Description: This command deletes the
To copy files: specified files. The /p switch causes Del prompt
Copy [Drive]\[Directory]\(File Name)[/v][/a][/b]
[Drive]\[Directory]\(Filename) you before a deletion actually occurs. If the
switch is specified, each file is displayed and you
And to append fines: are prompted with filename, delete (Y/N)? You
can either confirm the delete with a Y or cancel
Copy [Directory]\ (File Name) + [Directory]\ (File Name) the delete with an N.
[Directory]\ (Filename)
Example: this example will delete the file nms
from c:\
Description: This command copies one or
Del c:\nms
more files to another location. It also appends
files.
Also note
Deltree [E]
Copy Con <filename> can be used to create Syntax:
a file that copies the content of screen. In Deltree [drive:]\(directory)
other word it creates a file.
The copy command accepts the following Description: This command is used to delete the
switches: tree system of the directory. This command is
/v Causes DOS to verify that the used to delete the directory with subdirectory and
sectors written on the target disk are recorded files as well as to delete files. Where lets you
properly delete directory without any conformation.
Example:
Copy nms nmsag Warning ! Do not use this command
Copy con nms.txt unless you are sure that the directory is
1. Which copy nms file to nmsag useless.
2. create a file called nms.txt
Note: If you choose Copy con syntax then in Dir [I]
next line you have to type the text that Syntax:
DOS copies to the file and to end this mode Dir [drive:]\pathname[/option]
you have to press F6 function key or
Ctrl+z Description: The dir command lists all directory
entries in the working directory on the default
C:\>Copy a:\shiba\prince.exe drive. Dir also lets the drive’s volume label and
C:\>games\prince.exe volume serial number. And size and space
occupied of the drive.

4
MsDOS 8/12/2009
Example: Where exit command is use to exit to
st
Example: 1 example will list all files of working the windows in windows 95 or above version.
directory. 2nd example will display all files of
nmsag directory. 3rd directory will display if there Exit
is the given files or not where bag is a file name

Dir Find[E]
Dir nmsag Syntax:
Dir bag Find[/v][/c][/n] “string”
[[drive:]\[directory]\(filename)]
Diskcomp [E] Where: string is a group of characters you
want to search for.
Syntax:
Diskcomp [drive1:] [drive 2:] Description: The find command looks for
Where drive1 is the source drive. Drive w2 string(Text) in one or more files. After searching
is the target drive. the specified files, find displays any lines it has
found that contain the specified string.
Description: Diskcomp compares the contents
of the disk in the source drive to the disk in the The find command takes following switches:
target drive. It performs a track by track /V Displays all lines NOT containing the
comparison of the disks. It automatically specified string.
determines the number of sides and sectors per /C Displays only the count of lines containing
track based on the format of the source disk. the string.
/N Displays line numbers with the displayed
Example: This example compares the disk in a: lines.
with another disk in a: which it will ask to you. /I Ignores the case of characters when
Diskcomp A: B: searching for the string.
Where B: drive will also indicate drive A:
Example: The following command displays all
Diskcopy [E] lines from file pencil.ad that contain the string
Syntax: “Pencil Sharpener”:
Diskcopy [drive1:] [drive2] Find “pencil sharpener” pencil.ad
Where drive1 is the source drive. Drive2 is the
target drive.
Format [E]
Description: This command copies the contents Syntax:
of the floppy disk in the source drive to a Format [drive:]
formatted or unformatted floppy disk in the target Description: The format command creates the
drive. The size of the disk should be same. directory and the file allocation tables on a disk.
You can use this command when you have doubt
Example: This example copies all files and that your disk has some error.
directories of drive A: to drive B:
Diskcopy A: B: Example:
Format a:
The format command accepts the following
Exit [I] switches
Syntax: /q This switch helps you to do format quickly
Exit /s Transfer the system files (This switch is
available only up to windows 98 version.)
Description: It is used to exit to previous
windows or application from where MS-DOS Warning:
started in Shell mode. Do not use this command to hard disk
drive i.e. c:\>format c: or d:\format d:
it will cause your data lose.
National Microsystems) Ltdtd. 5
Formatting destroys any previously displays one screen of information at a time.
existing data on a disk and it ignores drive More is commonly used to view long files.
assignments created with the assign command. Example: you may use the dir command, the
sort command, or a filename as a source. The
Label [E] more command then pauses and displays the –
Syntax: More—message at the bottom of your screen.
Label [drive:][label] Press any key to display another screen of
Where label is the new volume label, up to information. Then, keep pressing the key until
11 characters. you have read all the data.

Description: This command creates, changes, or More < nms.txt


deletes the volume label on a disk.
Path [I]
Example: Syntax:
Label windows98 Path[drive:][path];[drive:][path]…….

Mem [E] Description: The main function of path is to


Syntax: create links with specified directories so that we
Mem[/program] need not to give the directory location to run any
program or files of the linked directory. The
Description: This command displays the amount maximum length of a command search path is
of used and free memory, lists allocated and 127 characters. The path command lets you tell
frees memory areas, and programs that are MS-DOS which directories to search for
loaded. executable commands – after it searches you
Mem accepts the following switches: working directory. Executable commands include
/program displays programs loaded in memory. files with a filename extension o .com, .exe or
.bat. The default value is no path.
Example:
Mem Example: path along with directories name is
used to create path between the directories.
Path; is used to remove the path.
Mkdir (md) [I]
Path is used to see the path.
Syntax:
Md [drive:]\(directory name) path
Path= c:\window;c:\windows\command;
Description: The md command lets you create a Path;
multilevel directory structure. The maximum
length of any single path from the root directory Prompt [I]
to the desired level cannot be more than 63
characters, including embedded backslashes. Syntax:
Prompt [text][$character]…]
Example: This example creates the directories Description: this command lets you change the
called book and its subdirectory pen. Ms dos system prompt (for example, A>). If,
C:\>Md book when using the prompt command, you do not
C:\ Md book\pen type a new value, the prompt is set to the default
value, which includes the default drive name.
More [I]
You can use the characters in the prompt
Syntax: command to create special prompt:
More<source $1 The = character
Or $$ The $ character
source|more $t The current time
Where source is a file or command. $d The current date
Description: More is a filter that reads from $p The working directory of the default drives
standard input (from a pipe o redirected file) and $v The version number
6
MsDOS 8/12/2009
$n The default drive
$g The > character
$b The | character
$_ To change the ling

National Microsystems) Ltdtd. 7


Example: This example is to change prompt to The sort command accepts the following
switches.
Current time 12:45:00
C:\>
/r reverses the sort; that is, sort from z to
Prompt
a, and then from 9-0
i.e. time in the one line and c:\> in
/+n sorts the file according to the character
the line.
Prompt $t$_$p$g in column n, where n is some number. If you
do not specify this switch, the sort common
Ren [I] sorts the file according to the character in the
Syntax: first column.

Ren [drive][path]\(source filename) [drive]\[path]\(Target Example: the following command reads the
filename) file expenses.txt, sorts it in reverse order,
and displays it on your screen:
Description: The ren command renames all files
Sort/r<expenses.txt
matching source file. However, because you
cannot rename files across disk drives, the en
command ignores any drive name that you Start [E]
specify with new filename. Syntax: Start <filename>

Example: In example 1st new name “ram” is Description: This command is use to open
given to the existing file raj. In 2nd example new windows base file from windows.
name “nmsit” is given to the file nms which is in Example: This example will open the nms.doc
the directory nmsag in c: file from windows directly.
Ren raj ram Start nms.doc
Ren c:\nmsag\nm s nmsit
Ren *.txt *.doc
Sys [E]
Rmdir (rd) [I] Syntax:
Syntax: Sys drive:
Rd [drive:] \ path
Description: The sys command transfers MS-
Description: Rmdir removes an empty directory. DOS system files from the disk in the default
Before you remove the directory you most delete drive to the disk in the specified drive. You must
all files and sub-directories of it. type a drive letter following the sys command. It
will copy io.sys, command.com and msdos.sys
Example: Where hari is an empty directory. files
Rd hari Example: example 1st transfer system files to
drive a: and example 2nd transfer the system to
Sort [I] drive c:
Sys A:
Syntax:
Sys C:
[source]|sort[/r][/+n]
or Note: We use this command when your computer
sort[/r][/+n]<source doesn’t boot and ask for system disk.
where source is a filename or
command. Time [I]
Syntax:
Description: The sort command is a filter Time [hours: minutes[seconds[.hundredths]]]
program that lets you alphabetize a file
accordant to the character in a certain Description: this command allows you to enter
column. or change the time known to the system. MS-
DOS keeps track of time in a 24 hour format, and

8
MsDOS 8/12/2009
uses the time information to update directory /e copies the empty directory
whenever you create or change a file. /s copies the sub-directories also
Example: To set a new time /v copies and verify that the directory is
Time 12:05:00 correctly copied or not

Type [I] Example: We are using xcopy to copy all


contents of drive a’s book directory to drive c’s
Syntax:
bag directory.
Type [drive] \path\ filename
C:\>Xcopy A:\book/s/e/a bag
Description: Type displays the contents of a text
file on the screen. You can use the command to Handling the disk
view a Some time you may have to take and get
Texts file without modifying it. files from one computer to another. So you must
know how to use disk.
Example: 1st helps you to view the data of file
hari. 2nd example helps you to view the data of Floppy Disks
pencil file which is located in pen sub-directory of A floppy disk is a flexible, magnetized plastic
book directory. disk. There are different types of floppy disks but
Type har most common floppy disk is 3.5-inch Disks
Type book\pen\pencil It is some time also called Microfloppy. Its
capacity is 1.44 Mb
Ver [I]
Syntax:
Ver Open read write area

Description: This command is use to know Hub Ring


about the edition of the operating system i.e.
Version.
Protecting screw Write Enable
Write Protect
Vol [I] Label

Syntax: Fig: 3.5-inch floppy disk


Vol [drive:]
Write protection: This is a condition when disk
Description: Vol displays the disk volume label is only permitted to read not write.
and serial number, if they exist. This command
displays the volume label of the disk in a specific Some conditions to handle of floppy disk.
drive. If you do not type a drive letter, MS DOS • When you are in C: and you want to do work
displays the volume label of the disk in the with floppy disk.
default drive. There are two ways to use floppy disk
same as wording directories.
Example: We us this example to view the volume 1. Type a: to use floppy disk. Then you will see
label of floppy drive. a:\> prompt instate of c:\>
Vol A:
DO YOUR WORKS like
Xcopy [E] If you want to list the files of directory as of a:
type dir as and press enter.
Syntax:
If you want to create file type copy con
Xcopy [drive:]\[path] [drive:]\[path]/a/e/s/v
filename and press enter.
Description: Xcopy copies files and directories,
including lower level directories, if they exist.
Note: notice that in above commands there is no
change even if it is used in a:. So you can use
The xcopy command accepts the following
your usual commands it floppy drive with no
switches:
change.
/a copies source files that have their archive
bit set.
National Microsystems) Ltdtd. 9
If you are in a: and you want to do work in This command is used to create new
c: file.
If you want to list the files of the directory of c: Open
type dir c:\as and press enter. This command is used to open the
If you want to create file in c: type copy con existing file. The following dialog box appears
c:\filename and press enter. If you want to choose drive or directories choose
Note: In this case note that the only different is it from directories: other wise choose the file
that ‘c:\’ is placed in front filename. Which is from file list. In the given fig. There is no file so
actually showing the path i.e. where is the file you have to choose the directory where your file
located? is located.

2. If you want to do work in a: from c:


If you want to list the files of the directory as a:
from c: type dir a:\as and press enter.
If you want to create file a: type copy con
a:\filename and press enter.

Note: In these examples the differences is that


‘a:\’ is placed in front of filename.
Just compare the above example with it and find
out the differences

Editing the data file (Edit)


Edit is the MS-DOS line editor that you can
use to create text files and save them on your
disks. Edit also helps you to update existing files
by deleting, changing, and inserting lines in
revise files such as memos, letters, reports etc.

To start with edit just type Edit and press enter.


The following screen appears. Fig. Open file.

Save
This command is used to save the working
file. If you want to choose other location choose
directory otherwise give filename and press
enter. The dialog box is given in the next page.

Save as
This command is used save the working
file in other location or other name which is
already been saved.
Close
This command is used to close the working
file.
Print
Fig Edit screen This command helps us to print the text
file.
There are different menus in edit command Exit
screen. This command helps use to exit to dos
mode.
File Menu
New

10
MsDOS 8/12/2009
Search Menu:
Find: This command is used to find the text within
the file. The dialog box is given below.
Steps to find the text:
• Give the text to find in filed what space.
• If you want to choose any option given in
the dialog box click to the square bracket
given
• Click to Ok

Fig. Save or Save As dialog box


Find last find
This command is used to find the last
Edit Menu searched text.
Replace:
Copy
This command is used to replace the find.
This command helps us to copy text to
Steps to find and replace the text you want.:
another location. For example if types one
paragraph and in next paragraph one line is same • Type the text to find in Find what square
to the typed paragraph than you can use copy bracket.
command instate of typing the whole sentence • Click to replace if you want to replace only
again. one find otherwise choose replace all.
Steps to copy text
1. To copy text select the text to copy
To select the text use shift and arrow
keys or drag the mouse.
2. Choose copy from edit menu
3. To insert the copied text choose paste
command from edit menu after inserting the
icon to the location where to copy.
Cut
This command is us to move the selected
text from one location to another location.
View menu:
Steps to text Split window:
1. To cut text select the text to copy This command will help you to break
To select the text use shift and arrow window into two windows so that you can work
keys or drag the mouse. easily.
2. Choose cut from edit menu Size windows:
This command will help you to adjust size
3. To insert the copied text choose paste
of the windows.
command from edit menu after inserting the
Close windows:
icon to the location where to copy.
This command will help you to close the
Clear
two windows.
This command is used to clear the
Files name.
unnecessary text.
In the view menu you can find the file
1. To clear text select the text to copy names. By clicking to the file name you can
To select the text use shift and arrow
change the working file.
keys or drag the mouse
Option menu:
2. Choose Clear command from Edit menu.

National Microsystems) Ltdtd. 11


This command helps you to set the printer Path and pathname
with setting command and color of the windows When you use multilevel directories, you
and fonts with color command. must tell MS-DOS where the files are located in
Help menu: the directory system. Both book and bag, for
This menu contains the help command and example, have files named sales.txt, so each
the product detail. would have to tell MS-DOS in which directory your
Wild card Characters file resides when you want to use it. This is done
Wild card characters i.e. ‘*’ and “?’ are those by giving MS-DOS a pathname to the file.
characters which helps us to do works easily. Eg. A pathname is a sequence of directories
You can copy numbers o files in one time. names followed by a filename. Each directory
name is separated from the previous one by a
* Stands for file name backslash ( \ ). A path differs from a pathname in
*. Stands for secondary(extension) name. that it does not include a filename.
*.* Stands for file name with extension.
? indicates one character. The general format of a pathname is
[\directoryname] [\directoryname… ] \
Examples: <filename>
Dir a*.??
This example helps you find all files which The path of sales.txt file is
starts with a and have 2 characters as extension. c:\book\sales.txt.
Copy *.a? C:\ indicate root directory.
This example helps you copy files which \book indicates the directory name.
have a as first character in extension and have 2 \sales.txt indicates the file name.
character as extension.]
Batch files: MS-DOS Error Message Directory
The files which help you to create A selection of the more important MS-DOS
environment do start any program easily called utility and device error messages is listed in this
batch files and have .bat as secondary name. chapter. Many screen messages are, however,
self-explanatory.
More About files and Directories If a disk or device error occurs at any time
during a command or program, MS-DOS displays
Multilevel Directories
When there is more than one user on your Abort, Ignore, Retry, Fail?
computer, or when you are wiring on several MD-DOS waits for you to type one of the following
different projects. The number of files in the responses:
directory can become large and unwieldy. To deal A Abort. End the program requesting the disk
with this large number of files, you may want to read or write.
keep your files separate from a coworker’s, or I Ignore. Ignore the bad sector and pretend
organize your programs into convenient they did not occur. This may result in lost data.
categories. R Retry. Repeat the operation. You should use
In an office, you can separate and organize this response when you have corrected the
files that belong to different people or that relate error (for example, with Not ready or Write
to specific projects by putting them in different protect errors).
files cabinets. You can do the same thing with Ms- F Fail. This causes the current MS-DOS
DOS by putting your files into different system operation to end (fail) and the
directories. application to continue.
Directories let you group your files in
convenient categories. These directories may Note for some floppy disk device error, the
contain other directories (referred to as sub- “Ignore” option will not be displayed. This prompt
directories). This organized file structure is instead will read
called Multilevel or Hierarchical Directory
System or Tree Structure. Abort, Retry, Fail?

Access denied
12
MsDOS 8/12/2009
Batch processing
You tried to replace a write- protected, read-only, You may often find yourself repeatedly
or locked file. typing the same sequence of commands to
perform some command task. With MS-DOS you
Bad command or file name can put this command sequence into a special file
that batch file. You don’t need to type the batch
The command cannot find the program you asked file’s extension, even thought all your batch files
it to run. Check to see that you typed the must include the .bat extension in their
command line properly, and that the file or filenames.
command is on the disk or in the command path.
How to create a filename.
Bad or missing Command Interpreter
You can create a batch file by using Edit
MS-DOS cannot find the command.com file on the command by using the copy command, or by
disk; either the file is missing from the root using a word processor that save files as ASCII
directory, or the file is invalid. You also receive text.
this message if command.com has been moved Creating a batch file
from the directory it was originally in when you Suppose, for example, that you want to create a
started MS-DOS. batch fi8le to format and check a new disk. To do
Either restarts the system with a disk that this, you simply furrow the steps:
contains thecommand.com file, or copy the 1. First, type the following:
command.com file from your backup MS-DOS Copy con checknew.bat
master disk onto the disk used to start MS-DOS. Press ENTER. This command tells MS-DOS to
copy the information from the console (key
Duplicate file name or file not found board) to the file checknew.bat.
You tried to rename to a filename that already 2. Next, type the following lines, pressing the
exists, or the name you specified could not be enter key after each:
found. Echo This is a file to format
Echo and check new disks.
File not found Echo It is named checknew.bat
MS-DOS could not find that file that you specified, Pause Insert new disk in drive a:
or you tried to rename a file with a name already Format a:/s
in the directory. Scandisk a:
Check to see that you entered the filename 3. After the last line, press control + z and then
correctly. press enter to save the batch file. MS-DOS
Insufficient disk space displays the message “1 file(s) copied” to
This disk is full and does not contain enough show that is created the file.
room to perform the specified operation. 4. Now to execute the file, simply type:
Invalid directory Checknew
The directory you specified either does not exist
or is invalid. Note:
Unable to create directory • You must name each batch file with an
MS-DOS could not create the directory you extension of .bat.
specified. • To execute a batch file, you type only its
Check to see that there is not a name conflict. filename not extension.
You may have a file with the same name, or the • Batch file can contain name of another
disk may be full. batch file.
Write protect error writing drive x:
You tried to write data on a write-protected disk.
If the disk has a write-protect tab on it, you must The Autoexec.bat file.
remove the tab before you can write on the disk
.If the disk doesn’t have a write protect notch. An autoexec.bat file lets you run programs
You cannot write on the disk. automatically when you start MS-DOS. This is
useful when you want to run a specific application
under MS-DOS, and when you want MS-DOS

National Microsystems) Ltdtd. 13


to execute a batch program each time you start You type MS-DOS commands using a
your computer. command prompt window. To end your MS-
DOS session, type exit in the command
How to create an Autoexec.bat file prompt window at the blinking cursor.
There are many things you can do with an
autoexec.bat file to help you use MS-DOS more The MS-DOS mode is a shell in which the MS-
efficiently. For instance, you will probably want to DOS environment is emulated in 32-bit
set the time and date, your path, and any other systems, such as Windows. MS-DOS-based
options that you plan to use on a regular basis.
programs can run with Windows and might
Note: When you create your autoexec.bat file,
create a program information file (PIF) which
you must put it in the root directory of your MS- appears as a shortcut on your desktop.
DOS.
Open the Command Prompt window.
For example:
1. Type the following command and then press Notes
ENTER
Copy con autoexec.bat • To open a command prompt, click
Start, point to Programs, point to
This command tells MS-DOS to copy what Accessories, and then click
you type from the keyboard into the autoexec.bat Command Prompt.
file. Notice that you must put the autoexec.bat
• Creating a program information file
file in the root directory of your MS-DOS DISK.
(PIF) for an MS-DOS-based program
2. Now type the following lines: creates a shortcut to the program
Date executable. All the settings saved in
Time the PIF file are contained in the
Path=c:\;c:\windows;c:\windows\command shortcut.
Prompt $t$_$p$g
Cls
3. After the last line, press CONTROL + z and New ways to do familiar tasks
press ENTER to copy these lines into the
autoexec.bat file.
Windows XP retains and enhances almost all
4. The menu program will now run automatically
whenever you start MS-DOS. MS-DOS functionality. The following tables
explain:
New ways to do familiar tasks
• Changes to the functionality of MS-DOS
MS-DOS overview commands.
• MS-DOS commands that are no longer
MS-DOS, the acronym for Microsoft Disk available in Windows XP.
Operating System, is an operating system • MS-DOS commands that are no longer
with a command-line interface used on available on Windows XP 64-Bit Edition.
personal computers. As with other operating
systems such as OS/2, it translates keyboard Changes to MS-DOS Commands
input by the user into operations the
computer can perform, it also oversees The following table lists changes to the
operations such as disk input and output, functionality of MS-DOS commands.
video support, keyboard control, and many
internal functions related to program
Comma
execution and file maintenance. Changed features
nd
Changes code pages for all
chcp
Command Prompt windows.
14
MsDOS 8/12/2009
diskco Command-line options /1 and /8 are dblspace Not currently supported.
mp not supported. The rmdir /s command deletes
No longer needed to act upon a directories containing files and
diskpe
server computer. You can still use deltree subdirectories. For more
rf
diskperf for remote administration. information about the rmdir
diskco Command-line option /1 is not command, see Rmdir.
py supported. dosshell Function is now inherent.
Available for all character-based drvspac
Not currently supported.
programs that accept buffered input. e
doskey
Doskey has been improved by a emm386 Function is now inherent.
series of enhancements. Not currently supported. Use the
Supports 1.44 MB floppy drive only. help command at the command
20.8 MB floptical (magneto-optical) prompt. For more information about
format drive is no longer supported. fasthelp the help command, see Help. For a
Command-line options /b, /s, /u, /1, complete list of command-line
/4, and /8 are no longer supported. tools, see Command-line reference
The caret (^) and ampersand (&) A-Z.
label symbols can be used in a volume Not currently supported. Use the
label. diskpart command, which enables
The mode lptn[:][cols=c][lines=n] you to manage disks, partitions, or
fdisk
mode and mode lptn[:][c][,[n]] syntaxes volumes. For more information
are not supported. about the diskpart command, see
Command-line options /b, /c, /m, /p, Diskpart.
print
/q, /s, /t, and /u are not supported. Multiple configurations of the MS-
include
New character combinations enable DOS subsystem are not supported.
you to add ampersands ($a), interlnk Not currently supported.
prompt
parentheses ($c and $f), and spaces intersrv Not currently supported.
($s) to your prompt. Increased partition size and an
recove join improved file system eliminate the
Recovers files only.
r need to join drives.
New /s command-line option deletes memma MS-DOS subsystem memory usage
rmdir directories that contain files and ker is automatically optimized.
subdirectories. menucol Multiple configurations of the MS-
Does not require TEMP environment or DOS subsystem are not supported.
sort
variable. File size is unlimited. menudef Multiple configurations of the MS-
New /g command-line option creates ault DOS subsystem are not supported.
xcopy
decrypted destination files. menuite Multiple configurations of the MS-
m DOS subsystem are not supported.
Unavailable MS-DOS Commands mirror Not currently supported.
msav Not currently supported.
The following MS-DOS commands are not
Use the ntbackup command for
available at the command prompt.
computers with tape drives, or the
xcopy command for computers
Comman New procedure or reason for msbacku without tape drives. For more
d obsolescence p information about the ntbackup
assign Not currently supported. command, see Ntbackup. For more
backup Not currently supported. information about the xcopy
choice Not currently supported. command, see Xcopy.
ctty Not currently supported. mscdex It is unnecessary to configure the
National Microsystems) Ltdtd. 15
MS-DOS subsystem to use CD-ROM Starts Edlin.exe, a line-oriented text
drives. Windows XP provides access edlin editor with which you can create and
to CD-ROM drives for the MS-DOS change ASCII files.
subsystem. exe2bi Converts .exe (executable files) to
Use the System Information snap- n binary format.
in. To start System Information, Expands one or more compressed
msd expand
click Start, click Run, and then files.
type msinfo32. Windows XP does not use this
numlock Not currently supported. fastope
command. It is accepted only for
n
power Not currently supported. compatibility with MS-DOS files.
restore Not currently supported. Starts the specified program in the
Not currently supported. Use the MS-DOS subsystem. This command
forcedo
chkdsk command, which enables is necessary only for those MS-DOS
s
you to create and display a status programs that are not recognized as
report for a disk based on the file MS-DOS programs by Windows XP.
scandisk
system. Chkdsk also lists and Loads a program into memory that
corrects errors on the disk. For allows you to print on a printer the
graphic
more information about the chkdsk displayed contents of the screen
s
command, see Chkdsk. when you are using a color or
smartdr Caching for the MS-DOS subsystem graphics adapter.
v is automatic. Ensures that a program is loaded
submen Multiple configurations of the MS- loadfix above the first 64KB of conventional
u DOS subsystem are not supported. memory, and then runs the program.
Windows XP does not fit on a Loads a program into the upper
sys standard 1.2 MB or 1.44 MB floppy memory area (UMA). Loading a
loadhig
disk. program into the UMA leaves more
h (lh)
undelete Not currently supported. room in conventional memory for
unforma other programs.
Not currently supported. Displays information about allocated
t
vsafe Not currently supported. memory areas, free memory areas,
mem and programs that are currently
MS-DOS commands no longer available loaded into memory in the MS-DOS
on Windows XP 64-Bit Edition subsystem.
Loads information specific to
The following 16-bit MS-DOS subsystem country/region. Windows XP does not
commands are not available on nlsfunc use this command. It is accepted
Windows XP 64-Bit Edition. only for compatibility with MS-DOS
files.
Comma
Function Sets the MS-DOS version number
nd
Enables programs to open data files setver that the MS-DOS subsystem reports
append in specified folders as if these files to a program.
were in the current folder. Windows XP does not use this
Starts Debug.exe, a program that share command. It is accepted only for
debug you can use to test and debug MS- compatibility with MS-DOS files.
DOS executable files.
Starts MS-DOS Editor, which creates
edit
and changes ASCII text files.

16

S-ar putea să vă placă și