Hi Friends, Welcome to (HACKING begins - "An approach to introduce people with the truth of HACKING"), In this article I'll tell you about BATCH file (.bat) programming. According to Wikipedia : a batch file is a text file containing a series of commands intended to be executed by the command interpreter.
In this article I'll introduce you with the basic of batch file and developing of batch programmes.
Batch file programming is nothing but the windows version of Unix Shell programming. In MS-DOS, a batch file can be started from the command line by typing its name (along with any required parameters) and pressing the "enter" key. When MS-DOS loads, the file AUTOEXEC.BAT is automatically executed, so any commands that need to be run to set up the MS-DOS environment for use could be placed in this file.
Why we need batch file programs ?
When we need to execute a set of commands over and over again to perform a routine task like backup files, Del temp files, then there is very difficult to type the same set of command over and over again, batch files are used.
Creation of batch file :
Batch files are basically plain text file containing DOS command. You can edit or write your batch file with notepad or DOS editor(EDIT). Always remember that a batch file should have an extension.BAT. Firstly you have to learn how you can change directory in DOS.
- MD A (Make directory "A")
- CD A (Change directory to "A")
- CD.. (Back to previous directory)
- CD\ (Back to c:\> directory automatically)
- ECHO
examples:
echo ON | {Restores normal display activity.} | |
echo OFF | {Halts display of DOS prompt and commands.} |
- REM
examples:
@rem {Hides the remark from display.}
- PAUSE
examples:
pause {Displays "Press any key to continue ...".}
- GO TO
examples:
goto LABEL
:LABEL
(you can replace label with any name you want)
- CLS
- IF [Conditional Branching]
Syntax : IF [NOT] EXIST FILENAME command
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
A program to to check the existence of a file (Example)
This is just an overview to guide you with BATCH programming, shortly i make an post with some batch programs by which you can also make prank or fake virus in batch programming.
No comments:
Post a Comment