Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

vbscript to verify application version

Updated: 22 May 2010 | 3 comments
pragmmativco's picture
0 0 Votes
Login to vote
This issue has been solved. See solution.

Hi there,

I am looking how to run a vbscript from Deployment Console (6.9), which will check if  version "C:\Program Files\Mozilla Firefox\firefox.exe" is equal or less than 3.0.4, then run firefox.exe (3.0.10)

I was trying to test
 
"Function GetOfficeVersion(strComputer)
Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMI.ExecQuery( _
"SELECT Version FROM Win32_Product WHERE Name Like ' ")"

but I could not go anywhere, because of my basic vbscript knowledge, if you have any sample I will appreciate if you could share it...thanks

Comments

mlombardo's picture
01
Jun
2009
0 Votes 0
Login to vote

Try this: 'vbscript dim

Try this:

'vbscript
dim verNum
Set objFSO = CreateObject("Scripting.FileSystemObject")

verNum= objFSO.GetFileVersion("C:\Program Files\Mozilla Firefox\firefox.exe")

If Left(verNum,5)<3.0.5 then <path_to_executable>

Biohazzard's picture
02
Jun
2009
1 Vote +1
Login to vote

I like how that counted the

I like how that counted the charactors over. ...Or you could do this:

'vbscript
dim file1
dim version

FILE1 = "C:\Program Files\Mozilla Firefox\firefox.exe"
version = ("3.0.4")
Set objFSO = CreateObject("Scripting.FileSystemObject")

If objFSO.GetFileVersion(FILE1) < version Then
WshShell.run(path to executable)

end if
 

pragmmativco's picture
02
Jun
2009
0 Votes 0
Login to vote

file version

Thanks for the hints, much appreciated

I tried If Left(verNum,5)<3.0.5 then <path_to_executable>, but I got error , Line 7 char 22 expected Then, but I did not know how to fix it sorry

I tried If objFSO.GetFileVersion(FILE1) < version Then WshShell.run(path to executable). for this one I needed to add Set WshShell  and it worked fine

thanks for your help....