請問批次檔如何變數累加 - Windows

Table of Contents

我想一個變數累加1到100
並每次echo出來
有在網路上找過但找沒有
不知道有人可以指導一下怎麼寫嘛?
感謝~

--

時光 美麗動人 如何不捨都要分 
如何不捨都要忍 再獨行

--

All Comments

Michael avatarMichael2010-07-24
for /l %%n in (1,1,100) do (echo %%n)
Joseph avatarJoseph2010-07-26
看錯
Caitlin avatarCaitlin2010-07-31
set t=0
for /l %%n in (1,1,100) do (set /a t+=%%n)
echo %t%