Why batch files are useful?
A batch file could
be used to run frequently run commands, deleting a series of files, moving
files, copying files etc. A simple batch file does not require any special
programming skills and can be done by users who only know DOS commands.
Create
your first batch file
- Open an MS-DOS command window.
- Change to the root directory of the C drive and create a directory
called BatchFiles. You can use
this directory to save your
batch files.
- Change into Batchfiles
folder. Create a new file called Ex1.bat using notepad.
- To do this type notepad ex1.bat at the command
line.
- Type in the following lines into the file and
Save. Each of the lines below is a command.
cls
ver
pause
dir c:\windows
dir c:\windows
- Before continuing,
can you remember what the effect of each of the 4 commands that you have
typed into the file? If not – look
them up in the help.
- Make sure
you are in the Batchfiles
folder.
- Key in DIR and MAKE SURE you see a file called EX1.BAT
- At the prompt, type
in the name of the batch file i.e. Ex1 and press Enter.
1 Comments
Thanks for the Great Post about DOS Batch file system. Now I am Clear about the Batch................
ReplyDelete