
November 29th, 2007, 07:32 PM
|
|
Registered User
|
|
Join Date: Nov 2007
Posts: 1
Time spent in forums: 58 m 43 sec
Reputation Power: 0
|
|
|
Batch File Variable Addition
Hi all, what I'm trying to do is simple but I can't quite figure it out in a batch file.
I need a single variable to hold the amount of <something>, and as the batch file runs through, given a success or failure error code, add to the variable so it can be output at the end.
The number of statements will be in excess of 100, fyi.
Code:
set MyVariable=0
if <statement is valid>
set %MyVariable% = %MyVariable%++
(What I'm trying to acheive, add 1 to the current Variable)
echo Total Valid Statements: %MyVariable%
Any and all help is much appreciated!
|