• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 713
  • Last Modified:

.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
0
Occam
Asked:
Occam
  • 2
1 Solution
 
pschakravarthiCommented:
Check this

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)
      DrVerArray=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
                        End If
                  End If
            End If
      End If
      If InstallIt Then
            Wscript.Echo "Installing"
            'Shell.Run "c:\intel_driver\xp142550.exe",10,TRUE
      End If
End If
0
 
OccamAuthor Commented:
Thank you!  That fixed the issue with the script.
0
 
OccamAuthor Commented:
Do not close this thread. THe solution was valid. Please keep it in the stack
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now