Before we explain the ways of making a batch file, we will give a brief introduction to batch file.
<Skip this if you know already>
So what is a batch file?
A executable file that can perform DOS commands is called a batch file.
In Ms.DOS, there are a set of commands used to perform various tasks. If you open Ms.DOS and type the commands directly there, it is called an internal command.
Making and using a batch file is called using external commands, because the user does not need to actively enter the commands. A set of predefined commands will be automatically executed by the batch file.
How to make a batch file?
If you already know how to use Ms.DOS commands, you can simply open "notepad.exe" from run and type the commands line by line. Here's an example.
This was a very basic DOS batch file. If you are proficient enough, batch files can be very lethal too. They can be easily used for pranking, making viruses, or even a very interesting program.
Here's an example. You should try it. Download here! Click me!
COMMENTS:
<Skip this if you know already>
So what is a batch file?
A executable file that can perform DOS commands is called a batch file.
In Ms.DOS, there are a set of commands used to perform various tasks. If you open Ms.DOS and type the commands directly there, it is called an internal command.
Making and using a batch file is called using external commands, because the user does not need to actively enter the commands. A set of predefined commands will be automatically executed by the batch file.
How to make a batch file?
If you already know how to use Ms.DOS commands, you can simply open "notepad.exe" from run and type the commands line by line. Here's an example.
- Open "notepad.exe" from run or start menu.
- Type this inside:
@echo off
title Example of batch file
echo Hello World
echo.
pause
exit
- Save it as sth.bat somewhere.
- Go to the place where you saved it.
- Open the file by double clicking it.
- It will display "Hello World" and ask you to press any key to continue.
- Once you press a key, it will exit.
This was a very basic DOS batch file. If you are proficient enough, batch files can be very lethal too. They can be easily used for pranking, making viruses, or even a very interesting program.
Here's an example. You should try it. Download here! Click me!
Any Queries? Please drop a comment to let us know.
No comments:
Post a Comment