Hello There,

I wish to write a script to search for files with certain extension and these files are located on network drives. Now, the dummy script which i created does work , but takes around a week to generate the report for the files. When the same set of files are scanned using the inbuilt search tool of windows, I can have the same report generated in a few minutes. I would be very grateful , if someone can guide me , if there are any API's that needs to be made use of for generating report faster?

3 Comments   [ - ] Hide Comments


  • Have a look Tree Size by Jam Software, I think that will do some reports for you out of the box, been ages since ive used it though. Not sure if this will help, hey-ho (:
    • i do have another s/w of similar functionality. but what i m planning to do is completely different
  • We have done this in the past for network storage volumes. We break the scan up by volume and have results emailed out after a volume scan is complete; our volumes ranged from 1tb to 4tb. We used a Linux computer to mount and scan the volumes. With all scans complete we probably looked through 10+tb in a night. What size volumes are you working with?
  • >What size volumes are you working with?
    More importantly, how are you building the list of files and folders and in what language? If you're building strings in VBScript, for example, the script will start to slow down as the interpreter (let's call it) tries to handle them as they grow. I'd probably use an ADO recordset.
Please log in to comment

Answer this question or Comment on this question for clarity



We set up the script to scan on the servers that the sans are attached to instead of network attached workstations.  We have them scheduled as a task at night and the reports are there on a central share in the morning

Answered 07/09/2013 by: SMal.tmcc
Red Belt

  • You use wmic to search the drives and output to a file. would be a variation of my answer to this question.

    WMIC datafile WHERE "drive='n:' AND Extension='mpg' OR drive='n:' AND Extension='jpg'" get name and add the /format switch to end to create an output file
  • This content is currently hidden from public view.
    Reason: Removed by member request
    For more information, visit our FAQ's.
Please log in to comment

example Powershell script (this script looks for .ini and stores result to c:\output\output.csv. Modify paths and file extension to search as required):


$info = @()

$outputFile = "C:\Output\output.csv"

$iniFiles = get-childitem -recurse -path $sourceFiles -include *.ini
ForEach ($file in $iniFiles)
$record = ""|select-object File_Name

$record.File_Name = $file.FullName

$info += $record



$info|export-csv $outputFile -NoTypeInformation

Answered 07/09/2013 by: SnowLyric
Second Degree Brown Belt

  • Thank you..........all of you. Will try to implement the solution suggested by you'll and will let u know its output
Please log in to comment