WMI FileSpecification class 
Author Message
 WMI FileSpecification class

The WMI "FileSpecification" class seems to default to the
Program Files folder on my test system. Is there a way to
specify a different folder?

Here's my slightly-modified code (only provides specs for
the ASP.TLB file):

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer
& "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
    ("Select * from Win32_FileSpecification Where
Description = 'ASP.TLB'")
For Each objItem in colItems
    Wscript.Echo "Attributes: " & objItem.Attributes
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "CheckID: " & objItem.CheckID
    Wscript.Echo "CheckMode: " & objItem.CheckMode
    Wscript.Echo "CheckSum: " & objItem.CheckSum
    Wscript.Echo "CRC1: " & objItem.CRC1
    Wscript.Echo "CRC2: " & objItem.CRC2
    Wscript.Echo "CreateTimeStamp: " &
objItem.CreateTimeStamp
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "FileID: " & objItem.FileID
    Wscript.Echo "FileSize: " & objItem.FileSize
    Wscript.Echo "Language: " & objItem.Language
    Wscript.Echo "MD5Checksum: " & objItem.MD5Checksum
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "Sequence: " & objItem.Sequence
    Wscript.Echo "SoftwareElementID: " &
objItem.SoftwareElementID
    Wscript.Echo "SoftwareElementState: " &
objItem.SoftwareElementState
    Wscript.Echo "TargetOperatingSystem: " &
objItem.TargetOperatingSystem
    Wscript.Echo "Version: " & objItem.Version
Next

Thanks in advance,

Bill



Mon, 01 Aug 2005 06:01:58 GMT  
 WMI FileSpecification class
Had a good response recently.

Try the Norwegian MVP of this group.


Quote:
> The WMI "FileSpecification" class seems to default to the
> Program Files folder on my test system. Is there a way to
> specify a different folder?

> Here's my slightly-modified code (only provides specs for
> the ASP.TLB file):

> On Error Resume Next
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:\\" & strComputer
> & "\root\cimv2")
> Set colItems = objWMIService.ExecQuery _
>     ("Select * from Win32_FileSpecification Where
> Description = 'ASP.TLB'")
> For Each objItem in colItems
>     Wscript.Echo "Attributes: " & objItem.Attributes
>     Wscript.Echo "Caption: " & objItem.Caption
>     Wscript.Echo "CheckID: " & objItem.CheckID
>     Wscript.Echo "CheckMode: " & objItem.CheckMode
>     Wscript.Echo "CheckSum: " & objItem.CheckSum
>     Wscript.Echo "CRC1: " & objItem.CRC1
>     Wscript.Echo "CRC2: " & objItem.CRC2
>     Wscript.Echo "CreateTimeStamp: " &
> objItem.CreateTimeStamp
>     Wscript.Echo "Description: " & objItem.Description
>     Wscript.Echo "FileID: " & objItem.FileID
>     Wscript.Echo "FileSize: " & objItem.FileSize
>     Wscript.Echo "Language: " & objItem.Language
>     Wscript.Echo "MD5Checksum: " & objItem.MD5Checksum
>     Wscript.Echo "Name: " & objItem.Name
>     Wscript.Echo "Sequence: " & objItem.Sequence
>     Wscript.Echo "SoftwareElementID: " &
> objItem.SoftwareElementID
>     Wscript.Echo "SoftwareElementState: " &
> objItem.SoftwareElementState
>     Wscript.Echo "TargetOperatingSystem: " &
> objItem.TargetOperatingSystem
>     Wscript.Echo "Version: " & objItem.Version
> Next

> Thanks in advance,

> Bill



Mon, 01 Aug 2005 16:01:13 GMT  
 WMI FileSpecification class

Quote:

> The WMI "FileSpecification" class seems to default to the
> Program Files folder on my test system. Is there a way to
> specify a different folder?

Hi

I don't know if that is possible, but you should post to
microsoft.public.win32.programmer.wmi, where the WMI experts hang out.

URL to the WMI newsgroup for those who uses the not so good Web interface to
access the newsgroups:
http://communities.microsoft.com/Newsgroups/default.asp?ICP=MSCOM&sLC...

--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and a ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter



Mon, 01 Aug 2005 17:08:08 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. WMI NetworkAdapter Classes

2. Determining what properities are available for a WMI Class

3. WMI VBS WSH Classes

4. SCRIPT: Getting System Times on a Class C Subnet via WMI

5. class in a class

6. Any problems with VBScript class containing another class?

7. wmi core and wmi sdk...

8. Strange behavior of VBscript/WMI into ASP (compared to VBscript/WMI into client-side application)

9. Problems with CheckAccess method of WMI Registy Provider class (StdRegProv) ?

10. Problems with CheckAccess method of WMI Registy Provider class (StdRegProv) ?

11. Is there some reasonable way to lookup WMI classes & properties?

12. WMI on WinXP RC1: "Interface: Class not registered"

 

 
Powered by phpBB® Forum Software