Gaz11uk Posted July 7, 2011 Share Posted July 7, 2011 Hi, I’m pretty new to Autoit so this will probably be a really silly question. I’m trying to check the version of a file and then do a if the file is = 1.2.3.4 then do x. but i can’t seem to get AutoIt to accept the file version that i want to check against. Below is the code I’ve got so far. Thanks for your help #NoTrayIcon $Version = FileGetVersion ("C:\Windows\system32\urlmon.dll","FileVersion") $a_Vaule = RegRead("HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile", "Flags") If @error Or $a_Vaule = 0 Then $a_Status = 0 Else $a_Status = 1 EndIf SetError(0) $b_Vaule = RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager", "PendingFileRenameOperations") If @error Then $b_Status = 0 Else $b_Status = 1 EndIf If $a_Status = 1 or $b_Status = 1 Then $Reboot = 1 Else $Reboot = 0 ;Computer needs rebooted if $Version = 8.0.6001.1907 and $Reboot = 1 Then MsgBox (1,"Reboot Required", "A reboot is require in order to fix a Internet Explorer issue") RegWrite('HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{ComputerLand - Internet Explorer 8 Fix}') RegWrite('HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{ComputerLand - Internet Explorer 8 Fix}',"",'REG_SZ','Internet Explorer 8') ;rights to default key "" RegWrite('HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{ComputerLand - Internet Explorer 8 Fix}','ComponentID','REG_SZ','Internet Explorer 8') RegWrite('HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{ComputerLand - Internet Explorer 8 Fix}','StubPath','REG_SZ','C:\Program Files\marimba\Delivery\CL01441\InstallPatch.exe') RegWrite('HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{ComputerLand - Internet Explorer 8 Fix}','IsInstalled','REG_DWORD',00000001) RegWrite('HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{ComputerLand - Internet Explorer 8 Fix}','Version','REG_SZ','1,0,0') ElseIf $Version = 6.0.2900.5969 and $Reboot = 0 Then Run ("C:\Program Files\marimba\Delivery\CL01441\IE8-WindowsXP-KB2530548-x86-ENU.exe"&" "&"/quiet /noreboot") EndIf EndIf Link to comment Share on other sites More sharing options...
Gaz11uk Posted July 7, 2011 Author Share Posted July 7, 2011 no, i figured it out. was being silly!!!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now