Having an issue whereby I cannot seem to make the following script work. Basically as a summary I need to ensure a version of an application is greater than 2.0.0.8
So here is my code:
setlocal enabledelayedexpansion
set n2=2.0.0.8
FOR /F "tokens=2* delims=0 " %%A IN ('REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall
\FB58E75BC1D58DF60340894DB00D3FA9BBD513B6" /v displayversion') DO SET n1=%%B
IF %n1% GEQ %n2% (goto success) else (goto error)
:success
start notepad.exe
Goto:eof
:error
start winword.exe
Goto:eof
:eof
exit
The output works fine and n1 outputs a version greater than 2.0.0.8 (it output 2.0.0.12) using notepad and winword launching purely as testing.
No matter what it always errors and opens Winword.exe
The value in testing is 2.0.0.12 so why is this still erroring out?
Hope this makes sense
Thanks
Mikoyan