China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-12 21:35
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How do you use numeric variables in .bat (not string variables) View 1,149 Replies 1
Original Poster Posted 2003-11-05 00:00 ·  中国 安徽 合肥 电信
初级用户
★★
Credits 311
Posts 62
Joined 2003-08-16 00:00
22-year member
UID 8721
Gender Male
Status Offline
For example, if I want to set a variable count=5, and then make count-1 each time through the loop, how should I do it?
set count=5
set count=%count%-1 then it becomes count=5-1 instead of the count=4 I want
What should I do?
一切都会好起来的
Floor 2 Posted 2009-12-25 11:33 ·  中国 重庆 电信
初级用户
Credits 20
Posts 11
Joined 2009-12-05 17:26
16-year member
UID 155977
Gender Male
Status Offline
Check the parameters for SET. There is a /A for calculation.
Forum Jump: