Now aren't I glad I gave you a longer but easier to understand solution... Lines 1 & 2 turn off echoing to the console and ensure that all variables are locally set. Lines 3, 4 & 5 is my way of setting the key you gave for the registry data we're looking for. It is considered good practice when coding to maintain maximum character line lengths, in this case 80 characters; so I've split it across 3 lines for this reason. The For loop is where it gets interesting... I took your reg query command and put it inside the parentheses. because your output produced more than one line I needed to capture only the line containing your version data so I sent the result of the reg query through a find command to pick up the line containing REG_ the output of the data is TAB delimited (delims=<TAB>) into distinct columns. the data you wanted was in the third column (tokens=3) Basically any data in third column of that key will be set to the local variable %rel% All we do then is a simple `if result of query is not our data then perform this task` line. For that line, i.e. your installation, you could see if you can use silent switches too, this would remove any end-user interaction!