Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering by extended file properties 1

Status
Not open for further replies.

nonya88

Programmer
Aug 28, 2009
2
US
Hello,

I have a task that requires searching through four directories on a server, and deleting certain specified files using VBScript. These files to be deleted are *.tif files (faxes) and these *.tif files must be created by Windows NT Fax Server. The problem that I'm running into involves this second condition; filtering by the creation software (in this case Windows NT Fax Server.)

I've attemped to incorporate WMI's CIM_DataFile and CIM_LogicalFile properties, but recognition of the creation software isn't one of their properties. I'm not aware of any FileSystemObject property that would allow me to see this creation software either.

Any help or suggestions are greatly appreciated!

Nonya88
 
Conceptually, I would open a .tif file and read the header data to identify any program signatures. Unfortunately, I have no code examples because "conceptually" can't be compiled. :)

-Geates
 
Something like:
Code:
[blue]Const SH_COLUMNHEADER_PROGRAM = 35

Public Function GetCreateProgram(strFilePath)
    Dim objFso 
    Dim objShell 
    Dim objFolder 

    Set objFso = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace(objFso.GetParentFolderName(strFilePath))
    GetCreateProgram = objFolder.GetDetailsOf(objFolder.ParseName(objFso.GetFileName(strFilePath)), SH_COLUMNHEADER_PROGRAM)
End Function[/blue]
 
Thanks Geates and strongm!

I will test this script and check if it meets my needs.

Thanks again!

nonya88
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top