Update running unsigned long long sum in bat file

Viewed 85

Is there a simple way to sum two numbers potentially >= 2*31 in a .BAT file? I have a running sum, and argument %1 that is the name of an existing file.

set sum=4123456789
set fsize=%~z1

I'd like to add fsize to sum. Unfortunately fsize (and sum) can be as tiny as zero or 10's of gigabytes (%~z1 accurately reports >= 2*31 file sizes).

I know a program could do it, and I'll go that route if necessary, but I'd prefer to do it with a few added lines of .BAT logic.

2 Answers
Related