Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Win32_QuickFixEngineering gives no InstallDate

432 views
Skip to first unread message

Andrew Williamson

unread,
Feb 11, 2004, 12:00:27 PM2/11/04
to
Hi

Anyone know why the InstallDate is always blank on WinXP?

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
Set colQuickFixes = objWMIService.ExecQuery _
("Select * from Win32_QuickFixEngineering")
For Each oQF in colQuickFixes
wscript.echo oQF.HotFixID & " - " & oQF.InstallDate & " - " &
oQF.InstalledOn & " - " & oQF.Description
Next

Output:
Q815021 - - - Windows XP Hotfix (SP2) Q815021
Q817287 - - - Windows XP Hotfix (SP2) Q817287
Q817606 - - - Windows XP Hotfix (SP2) Q817606

Dates missing. What's up?

I notice in the registry the field is called InstalledDate, not
InstallDate, but of course that property doesn't exist. There's also
an InstalledOn property which is also blank.

This has been confirmed here:

http://groups.google.com/groups?dq=&hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=62a595cc.0402060358.4ba05e13%40posting.google.com&rnum=1&prev=/groups%3Fdq%3D%26start%3D25%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26group%3Dmicrosoft.public.windows.server.scripting%26selm%3D62a595cc.0402060358.4ba05e13%2540posting.google.com

AW :)

Chung-Wei Foong [MSFT]

unread,
Feb 11, 2004, 6:14:31 PM2/11/04
to
Unfortunately the date fields are null and we are aware of the situation.

Here is a partial workaround. You can use the registry provider to get those
InstalledDate values that exists in the registry. Here is a mof that you can
modify/try.

(Note this is a just a sample mof and you may not have these hotfixes
installed and thus there maybe no instances. You can modify the registry
keys in the ClassContext to point to the hotfixes that you are interested
in)

qualifier dynamic:ToInstance;
qualifier ProviderClsid:ToInstance;
qualifier ClassContext:ToInstance;
qualifier propertycontext:ToInstance;

[dynamic, provider("RegProv"),
ProviderClsid("{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}"),
ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Updates\\DataAc
cess")
]
class Updates {

[key] string KeyName;
[read, propertycontext("Description")] string Description;
[read, propertycontext("InstalledDate")] string InstalledDate;

};

[dynamic, provider("RegProv"),
ProviderClsid("{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}"),
ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Updates\\Window
s XP\\SP1")
]

class UpdatesXP {

[key] string KeyName;
[read, propertycontext("Description")] string Description;
[read, propertycontext("InstalledDate")] string InstalledDate;

};

After compiling this mof, you can go to root\default namespace and enum
instances with the dates for the classes (in this case Updates and
UpdatesXP). Hope this helps.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Andrew Williamson" <andrew...@mailinator.com> wrote in message
news:62a595cc.04021...@posting.google.com...

Andrew Williamson

unread,
Feb 12, 2004, 4:53:15 AM2/12/04
to
"Chung-Wei Foong [MSFT]" <chu...@online.microsoft.com> wrote in message news:<eJUKQTP...@tk2msftngp13.phx.gbl>...

> Unfortunately the date fields are null and we are aware of the situation.
<snip>

Thanks for the confirmation and workaround :)

Rgds

AW

Andrew Williamson

unread,
Feb 12, 2004, 11:36:11 AM2/12/04
to
andrew...@mailinator.com (Andrew Williamson) wrote in message news:<62a595cc.04021...@posting.google.com>...

> "Chung-Wei Foong [MSFT]" <chu...@online.microsoft.com> wrote in message news:<eJUKQTP...@tk2msftngp13.phx.gbl>...
> > Unfortunately the date fields are null and we are aware of the situation.
> <snip>

This got me thinking and looking around a little more. In
%SYSTEMROOT%\WBEM, I found the file cimwin32.mof which contained the
following section:

[Dynamic,Provider("CIMWin32") : ToInstance,Locale(1033) :
ToInstance,UUID("{0827250D-BA3E-11d2-B361-00105A1F77A1}") :
ToInstance]
class Win32_QuickFixEngineering : CIM_LogicalElement
{
[read : ToSubclass,key : ToInstance ToSubclass
DisableOverride,MaxLen(260) :
ToSubclass,MappingStrings{"Win32Registry|SOFTWARE\\Microsoft\\Windows

NT\\CurrentVersion\\Hotfix"} : ToSubclass] string HotFixID;
[read : ToSubclass,key : ToInstance ToSubclass
DisableOverride,MaxLen(260) :
ToSubclass,MappingStrings{"Win32Registry|SOFTWARE\\Microsoft\\Windows

NT\\CurrentVersion\\Hotfix"} : ToSubclass] string ServicePackInEffect;
[read : ToSubclass,CIM_Key : ToSubclass,MaxLen(256) :
ToSubclass,Propagated("CIM_ComputerSystem.Name") :
ToSubclass,MappingStrings{"WMI"} : ToSubclass]

string CSName;
[read : ToSubclass,MappingStrings{"Win32Registry|SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\Hotfix"} : ToSubclass] string FixComments;
[read : ToSubclass,MappingStrings{"Win32Registry|SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\Hotfix"} : ToSubclass] string InstalledBy;
[read : ToSubclass,MappingStrings{"Win32Registry|SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\Hotfix"} : ToSubclass] string InstalledOn;
};

We can see there that InstalledOn is mentioned, but there doesn't
appear to be a mapping back to the registry. I tried changing that to
InstalledDate and running it through mofcomp on a spare machine, but I
got an error:

C:\WINDOWS\system32\wbem>mofcomp -class:createonly cimwin32.mof
Microsoft (R) 32-bit MOF Compiler Version 5.1.2600.1106
Copyright (c) Microsoft Corp. 1997-2001. All rights reserved.
Parsing MOF file: cimwin32.mof
Error, cannot combine autorecover with current flags/pragmasCompiler
returned error 0x0

Am I barking up the wrong tree here? Obviously, I'm fiddling around in
the dark a little - should this work however?

Thanks in advance :)

AW

Chung-Wei Foong [MSFT]

unread,
Feb 12, 2004, 12:12:36 PM2/12/04
to
Modifying the cimwin32.mof may result in adverse side effects. You may want
to stick to the workaround from my earlier post via the registry provider.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Andrew Williamson" <andrew...@mailinator.com> wrote in message
news:62a595cc.04021...@posting.google.com...

Andrew Williamson

unread,
Feb 13, 2004, 5:50:24 AM2/13/04
to
"Chung-Wei Foong [MSFT]" <chu...@online.microsoft.com> wrote in message news:<eJFArtY8...@TK2MSFTNGP09.phx.gbl>...

> Modifying the cimwin32.mof may result in adverse side effects. You may want
> to stick to the workaround from my earlier post via the registry provider.
>
> --
<snip>

The problem with my using that workaround is that this is a process I
need to run on remote machines. Not sure that this will work in those
circumstances.

Chung-Wei Foong [MSFT]

unread,
Feb 13, 2004, 12:21:36 PM2/13/04
to
This can work for remote cases as well, you can compile the mof on to the
remote machine via mofcomp.
See link for information:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/mofcomp.asp

Upon completion of the operation, you should be able to access the classes
with a script.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Andrew Williamson" <andrew...@mailinator.com> wrote in message
news:62a595cc.04021...@posting.google.com...

0 new messages