How to do simple math using DOS

The following list shows how you can use DOS to do basic arithmetic, for example sum, subtraction etc.

On this pageJump to a section

You can use these with other variables, for example if I hate a variables called %number% which was 11, I can use the following command to make it 10

DOS-Math1

Addition

SET /A Result = 12 + 4

Subtraction

SET /A Result = 23 - 7

Multiplication

SET /A Result = 8 * 2

Division

SET /A Result = 33 / 2

Reference: www.robvanderwoude.com/battech_math.php

Leave a Comment

Your email address will not be published. Required fields are marked *

Type guide in lowercase to submit your comment.