Thursday, May 6, 2010

Creating a batch file...

A batch file allows Windows users to run a sequence of commands automatically, after just double clicking (executing) the file. A batch file is just a file with an extension of ".bat", you can simply edit this file pressing 'edit' after right clicking on the file.

You can find some useful information about batch files, commands etc. from here.

Here's a simple batch file created by me:

cd /d C:\Documents and Settings\NirFLK\Desktop\Project2
auto_aaaBuild.exe C:\Program Files\aaa Applications\aaa.exe
CALL 2.bat
del 1.bat

Explanation:
line 1: Does the job of "cd" in a command prompt. (i.e. switch to the given path) Note: you need to include '/d'.
line 2: Running an exe file with a parameter
line 3: CALL used to execute another batch file within this batch file
line 4: After executing the 2.bat file, this line will delete itself.

No comments: