Now let’s move on to your first batch file program. We will first take up a simple batch file which executers or launches a .EXE program. Simply type the following in a blank text file and save it with a .BAT extension

C:

cd windows

telnet

Now, let’s analyses the code, the first line tells command.com to go to C: Next. it tells it to change the current directory to Windows. The last line tells it to launch the telnet client. You may contradict by saying that the full filename is telnet.exe, you are right the .exe extension in automatically added by command.com Normally, we do not need to change the drive and the directory as windows directory is the default DOS folder. So. instead the batch file could simply contain the below and would still work.

Telnet

Now, let’s execute this batch file and see what results it shows. Launch command.com (DOS) and execute the batch file by typing.

            C:\ Windows>Batch_file_name

You will get the following result:

                C:\WINDOWS >scandisk

And scandisk is launched. So, now that you know the basic functioning of batch files, let us move on to batch commands.

The REM command

 The most simple basic batch file command is the REM or the Remark command. Programmers to insert comments into their code to make it more readable and understandable. This command ignores anything there is on that line. Anything on the line after Rem is not even displayed on the screen during execution. It is normally not used in small easy to understand batch programs but is very useful in huge snipers of code, with geek stuff loaded. So, if we add Remarks to our first batch file, it will become:

 REM This batch file is my first batch program which launches the favorite hacking REM tool; Telnet.

  telnet

The only thing to keep in mind while using Remarks is not to go overboard and putting in too many of them into a single program as they tend to slow down the execution time of the batch command.

 Next---->

Hosted by www.Geocities.ws

1