Seite 1 von 1

reading version number from file in system32 directory

Verfasst: 04 Apr 2014, 15:48
von SisterOfMercy
I'm trying to read the fileversion of the windows update agent, to see if it needs to be installed, or not, if a newer version is installed.

Code: Alles auswählen

DefStringList $FileInfo$
DefVar $WindowsUpdateFile$
DefVar $WSUSversion$

Set $WindowsUpdateFile$ = "%systemroot%\system32\wuauclt.exe"
set $FileInfo$ = getFileInfoMap($WindowsUpdateFile$)
set $WSUSversion$ = getValue("FileVersion", $FileInfo$)
This doesn't work, I think because the call gets redirected to the syswow64 directory. In that directory is no such file, so this part of the log seems logical:

Code: Alles auswählen

[5] [Apr 04 15:08:23:843] Set  $WindowsUpdateFile$ = "C:\WINDOWS\system32\wuauclt.exe"
[6] [Apr 04 15:08:23:843]   The value of the variable "$WindowsUpdateFile$" is now: "C:\WINDOWS\system32\wuauclt.exe"
[5] [Apr 04 15:08:23:843] 
[5] [Apr 04 15:08:23:843] Set  $FileInfo$ = getFileInfoMap($WindowsUpdateFile$)
[4] [Apr 04 15:08:23:843]     File "C:\WINDOWS\system32\wuauclt.exe" does not exist
[6] [Apr 04 15:08:23:843]     retrieving strings from getFileInfoMap [switch to loglevel 7 for debugging]
[5] [Apr 04 15:08:23:843] 
[5] [Apr 04 15:08:23:843] Set  $WSUSversion$ = getValue("FileVersion", $FileInfo$)
[6] [Apr 04 15:08:23:843]     retrieving strings from $FileInfo$ [switch to loglevel 7 for debugging]
[6] [Apr 04 15:08:23:843]   The value of the variable "$WSUSversion$" is now: "NULL"
[5] [Apr 04 15:08:23:843] 
So does anybody know a way around this? Perhaps with sigcheck:
http://technet.microsoft.com/en-us/sysi ... 97441.aspx