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

  • 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?


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

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


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)


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