1.

Solve : Find out how many times a Batch is used.?

Answer»

that works- I still like my alternate datastream IDEA, though. How about this:

Code: [Select]setlocal
for /f %%a in (countit) do set count=%%a
set /a count=count+1
echo %count% >countit

it saves the count in a file called countit and increments everytime its run
Quote from: uSlackr on April 07, 2009, 03:16:32 PM

How about this:

Code: [Select]setlocal
for /f %%a in (countit) do set count=%%a
set /a count=count+1
echo %count% >countit

it saves the count in a file called countit and increments everytime its run


Why use FOR, when if does the trick.

Simple:
Code: [Select]if not exist times.txt echo 0 > times.txt
set /p times=<times.txt
set /a times+=1
echo %times% > times.txtQuote from: HELPMEH on April 07, 2009, 06:55:33 PM
Why use FOR, when if does the trick.

Simple:
Code: [Select]if not exist times.txt echo 0 > times.txt
set /p times=<times.txt
set /a times+=1
echo %times% > times.txt

I suspect its 6 of one, but I didn't know you could do that with set /p. COOL tip.

Thx

\\uSlackrQuote from: uSlackr on April 07, 2009, 10:13:21 PM
I suspect its 6 of one, but I didn't know you could do that with set /p. Cool tip.

Thx

\\uSlackr

I think that set is the most usefull COMMAND (that I can use...)


Discussion

No Comment Found