/build/static/layout/Breadcrumb_cap_w.png

Searching a file on network drives

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   [ + ] Show 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 (: - rileyz 10 years ago
    • i do have another s/w of similar functionality. but what i m planning to do is completely different - talonsprem87 10 years ago
  • 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? - Jbr32 10 years ago
  • >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. - anonymous_9363 10 years ago

Answers (2)

Posted by: SMal.tmcc 10 years ago
Red Belt
0

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


Comments:
  • You use wmic to search the drives and output to a file. would be a variation of my answer to this question.
    http://www.itninja.com/question/search-for-a-specific-file-type-and-then-list-them-in-the-custom-inventory-field

    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 - SMal.tmcc 10 years ago
Posted by: SnowLyric 10 years ago
Second Degree Brown Belt
0

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):

$sourceFiles="\\myserver\myshare\"

$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


Comments:
  • Thank you..........all of you. Will try to implement the solution suggested by you'll and will let u know its output - talonsprem87 10 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ