Flashback to what it took to do math in DOS batch files

While working on a script for an upcoming project, I wanted to test for the presence of various Office versions, including 32-bit and 64-bit components before initiating setup. Here’s one way I found:

SET CURRLOCATION32="C:\Program Files (x86)\Microsoft Office\root\Office16"
SET CURRLOCATION64="C:\Program Files\Microsoft Office\root\Office16"
SET PREV1LOCATION32="C:\Program Files (x86)\Microsoft Office\root\Office15"
SET PREV1LOCATION64="C:\Program Files\Microsoft Office\root\Office15"
SET PREV2LOCATION32="C:\Program Files (x86)\Microsoft Office\root\Office14"
SET PREV2LOCATION64="C:\Program Files\Microsoft Office\root\Office14"

REM Check for 64-bit versions
[ Continue reading ]