Hi and thanks in advance,
I am newbie at developing batch files but I am trying to write a bat file right now that will create and write to a ldif file. I am starting off with something simple 1st. I also need to time the process as it may get more complicated and I may need to do software comparisons later (such as bat vs. java later).
Right now I only got this:
@ echo "LDIF Generator"
@ echo off
:: *** Enter the file here "within the double quotes"
set fileName="test.ldif"
:: *** If file exists, then erase all previous content
::if exist %fileName% ECHO Erase the file >%fileName%
echo Hello>%fileName%
echo Created LDIF File %fileName%
set /a sum = 0
for /L %%A in (1,1,5) do (
echo %%A>>%fileName% set a/ sum = "%sum% + %%A"
)
echo sum is %sum%
pause
I am currently trying to figure out how to add up some numbers and time the process.
It gives me this output so far:
Hello
1 set a/ sum = 0 + 1
2 set a/ sum = 0 + 2
3 set a/ sum = 0 + 3
4 set a/ sum = 0 + 4
5 set a/ sum = 0 + 5
And on cmd sum is "0"
I am trying to it to show the current iterate sum and echo back the finally sum at the end and the time it takes to do that.