Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have been messing with the program for the past day and need some guidence. I want the script to verify if it has the latest of the given file and if not, to install it.
So far this is what I have:
sigcheck.exe -n -q "C:\myprogram.exe" |find | find "1.1.1.1" > nul
if not errorlevel 1 echo version 1.1.1.1 Found!!!
Im not sure what to do at this point. I know its not right, any ideas?Frank

for /f %%a in ('sigcheck -q -n "C:\myprogram.exe"') do set ver=%%a
if not "%ver%"=="1.1.1.1" installer.exe

I am attempting to check the version for adobe reader:
@echo off
Echo Checking for Adobe 5.0.5..for /f %%a in ('sigcheck -q -n "C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe"') do set ver=%%a
if not "%ver%"=="5.0.5.2001102600" echo Program Installed!
pause
The output says:Checking for Adobe 5.0.5..
Press any key to continue . . .Im not sure what to do from here. Looks like the code should work but not sure why it dosnt. I am goin to try it a couple other files to see what the output is.
Thanks for the help Razor.
-Frank

I think i got it. I took not out of the if line,
if "%ver%"=="5.0.5.2001102600" echo Program Installed!That seemed to work. If i change the version from 5.0.5.2001102600 to 5.0.5.20011026001111111 It dosnt find the program and I will have it start the install program.
-Frank

I have gotten it to work, just am having one issue.
if the version has commas in it:
1,1,0,1 or spaces 3 . 0
It dosnt work correctly. Any thoughts?

Not off the top of my head; the quotes should prevent such behavior. I'd suggest you remove the @ECHO OFF so you can see exactly what the script is doing.

Now that I think about it, we don't have to care.
for /f %%a in ('sigcheck -q -n "C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe"') do set ver=%%a
set ver=%ver: =.%
set ver=%ver:,=.%
if "%ver%"=="5.0.5.2001102600" echo Program Installed!

I just tried that in the script im using and it has no effect. Is there anything else i can try?
Thanks
Frank

Razor2.3
As you said, I took out the @echo off and ran the script. I found that the files with a space in the verson would not display anything past the space marker. So if the file was verson 2.0 RC2 it would omit the RC2. The rest started to work after that.
Thanks Again!Frank

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |