Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1077
  • Last Modified:

objFile properties

I have some code that scans a drive and reports back information on the file if it fits my criteria.

I'd like to be able to identify what other properties are available to me for the given file, so as to hopefully determin if there is a way to do a comparison with other file(s) found elsewhere with the same name.  For instance, below I'm referencing the file name and size.  Is there any other attribute that might contain a unique value that I can retrieve and compare?

====code======

Set objFSO = CreateObject("Scripting.FileSystemObject")
strComputer = "."
set objWMIService=GetObject("WinMgmts:{impersonationlevel=impersonate}!\\" & strComputer & "\root\cimv2")

set colSettings=objWMIService.ExecQuery ("Select * From Win32_ComputerSystem")
For each objComputer in colSettings
  strSrvName = objComputer.Name
Next

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strSrvName & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery ("Select * from CIM_DataFile")
  For Each objFile in colFiles
       'objFile.Name
       'objFile.FileSize
    end if
  Next
0
sirbounty
Asked:
sirbounty
1 Solution
 
armeenCommented:
these are all the methods and properties of the CIM_DataFile:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/cim_datafile.asp

You can check here - if you download the wmi tools, you get a WMI browser which will let you run queries and see what values *all* the properties have so you can find what you need. (http://www.microsoft.com/downloads/details.aspx?FamilyId=6430F853-1120-48DB-8CC5-F2ABDC3ED314&displaylang=en)

ed
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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