Link to home
Start Free TrialLog in
Avatar of Occam
Occam

asked on

.Dll version check and file install

I have been trying to write a script that will check the version of a particular .dll file and then if the version is not high enough it installs a driver.
The script seems to not check the version properly. Please advise

'On Error Resume Next
Set FS=WScript.CreateObject("Scripting.FileSystemObject")
Set Shell=WScript.CreateObject("WScript.Shell")
DLLFile= "igfxdo.dll"

If FS.FolderExists ("C:\WINNT\System32") Then
  WinDir="C:\WINNT"
Else
  WinDir="C:\WINDOWS"
End If
If FS.FileExists(WinDir&"\System32\”"&DLLFile) Then
  DriverVer = FS.GetFileVersion(WinDir&" \System32\"&DLLFile)
  DriverVerArray=Split(DriverVer,".")
   InstallIt=FALSE
  If UBound(DrVerArray)>=0 And CInt(DrVerArray(0))<6 Then
    InstallIt=TRUE
  Else If UBound(DrVerArray)>=1 And CInt(DrVerArray(1))<14 Then
    InstallIt=TRUE
  Else If UBound(DrVerArray)>=2 And CInt(DrVerArray(2))<10 Then
    InstallIt=TRUE
  Else If UBound(DrVerArray)>=3 And CInt(DrVerArray(3))<5502 Then
    InstallIt=TRUE
 Wscript.Echo "j"
  End If
  If InstallIt Then
    Shell.Run "c:\intel_driver\xp142550.exe",10,TRUE
  End If
  End If
  End If
  End If
  End If
Wscript.Echo "still broke"

Thanks for your help
ASKER CERTIFIED SOLUTION
Avatar of pschakravarthi
pschakravarthi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Occam
Occam

ASKER

Thank you!  That fixed the issue with the script.
Avatar of Occam

ASKER

Do not close this thread. THe solution was valid. Please keep it in the stack
Avatar of Guy Hengel [angelIII / a3]
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.