I am trying to create a script that will install all update files ending with the msp extension if the file version is lower then 9.5.4
I wrote the following script but I get that a colFiles.GetVersion method or property is not supported by this object error, what would be the correct way of addressing the task to get the version of each file in a folder
As a next step I like to check and compare the version of the file in the folder with the version of the executable file of an already installed application.
Dim WshShell, oExec, strCurrentVersion, strFileVersion
strCurrentVersion = "9.5.4"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("\\Server\ApplicationShare")
Set colFiles = objFolder.Files
Set colVersion = colFiles.GetFileVersion
For Each objFile in colFiles
IF right(objFile.Name,3) = "msp" Then
IF colVersion < strCurrentVersion Then
'Set WshShell = CreateObject("WScript.Shell")
'Set oExec = WshShell.Exec("msiexec /p " & objFile.path & " /norestart /qb REINSTALLMODE=ecmus REINSTALL=ALL") 'Execute Update
'Do While oExec.Status = 0