I have created a VBS script that will read from the system registry a products version number.

The 1st part detects what operating system you are using 64bit or 32bit, then assigns the strings as needed.

the 2nd part reads the keys, then depending on the output, will output the different results.

Const HKEY_LOCAL_MACHINE = &H80000002

strComputer = “.”
Set objRegistry = GetObject(“winmgmts:” & strComputer & “rootdefault:StdRegProv”)

Dim strComputer, objWMIService, colSettings, objProcessor

strComputer = “.”

Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate,authenticationLevel=Pkt}!” _
& strComputer & “rootcimv2”)

Set colSettings = objWMIService.ExecQuery _
(“SELECT * FROM Win32_Processor”)

For Each objProcessor In colSettings
‘Wscript.Echo “System Type: ” & objProcessor.Architecture
‘Wscript.Echo “Processor: ” & objProcessor.Description

‘ 9 is x64 Opperating system
if (objProcessor.Architecture) = “9” then
strKeyPath = “SOFTWAREWow6432NodeCortex I.TBackupAssistv5

Else

strKeyPath = “SOFTWARECortex I.TBackupAssistv5

end if
next
strValueName = “Version”
objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue

If IsNull(dwValue) Then
Wscript.Echo “Cant find BackupAssist
WScript.Quit(1)

elseIf (dwValue) >= “5.4.3” Then
Wscript.Echo “Upgrade not required (” & dwValue & “)
WScript.Quit(0)

elseIf (dwValue) <= “5.4.2” Then
Wscript.Echo “Upgrade Requied (” & dwValue & “) Version 5.4.3 required
WScript.Quit(1)

Else
Wscript.Echo “BackupAssist not found (” & dwValue & “) Version 5.4.2 required
WScript.Quit(1)
End if

You can edit the paths, and the versions to suit any product you want, simply change the areas in red to suit your products. I use the exit codes to create errors in GFIMax

« »