Header Ads

How to run more than one commands automatically in a sequence in MS-DOS?


In MS-DOS if you want to run more than one commands automatically then you should use batch file. Batch file is a command used in ms-dos to perform multiple commands automatically in a sequence, it’s extention is .bat which must be use to create a batch file.
Q -How to create a batch file?
Ans:- To create a batch file follow the instruction given below
Syntax:-    C:\ copy con <File Name>.bat
Command name1
Command name2
……………………
……………………
Command name n
(now save the file with either “F6” of “CTRL+Z”

Note:- Use only one command in one line.
Q :- How to run batch file?
Ans: It’s very easy to run any batch file follow the given instruction to run any batch file

Syntax:- C:\ BatchFileName.bat
                           OR
Syntax:- C:\ BatchFileName

Note:- You don’t have to use any command to run a batch file only type the file name either with extention or without extention.

Let’s see a example to use the batch file.
Example:-     Q:- How to run more than one following commands automatically in a sequence
                            dir
                            date
                            time
                            ver
                            cls

Ans:-    C:\ copy con test.bat
                            dir
                            date
                            time
                            ver
                            cls
^z ( Press “F6” to save the file)

Your file is now created and to run this just type the name of the batch file as shown in the tutorial above.

No comments

Powered by Blogger.