Computing.Net > Forums > Disk Operating System > evaluate expression in DOS

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

evaluate expression in DOS

Reply to Message Icon

Name: aqua
Date: November 8, 2003 at 22:57:33 Pacific
OS: win XP
CPU/Ram: 512
Comment:

I want to evaluate an expression of form i = i+1, i being a varaible. Is there a way to do in DOS shell?? Later on value of variable i will be used to append in filename
I know in UNIX one can use expr.

Please suggest



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: November 10, 2003 at 01:18:00 Pacific
Reply:

Using the extension of batch language offered by Win NT/2K/XP console (DOS is what you *believe* to interact with) you can write

Set I= your initial value...
Set /A I=%I%+1

and so on. To know more see at prompt Cmd /C Set /? where you find the full tutorial about arithmetic in scripts.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: evaluate expression in DOS

resolution in DOS www.computing.net/answers/dos/resolution-in-dos/3539.html

Launching Outlook Express from DOS. www.computing.net/answers/dos/launching-outlook-express-from-dos/2977.html

How do i start up in DOS www.computing.net/answers/dos/how-do-i-start-up-in-dos/11506.html