Dir and Findstr commands taking a long time to complete in Batch File

Posted by user2405934 on Super User See other posts from Super User or by user2405934
Published on 2014-03-27T20:31:00Z Indexed on 2014/08/24 16:22 UTC
Read the original article Hit count: 242

Filed under:
|
dir %DRIVE_NAME%: /S /C /A-D /Q /T:C | findstr ".zip$ .doc$ .xls$ .xpt$ .cpt$ .cpo$ .xlsx$ .pdf$ .dat$ .txt$ .docx$ .csv$" >> file.info

I am using above command to list all information in file, as below:

03/27/2013  01:02 PM   86,280 uusr\fr02        h123_frf67_rk_20140327.txt
03/27/2013  01:02 PM    5,513 usr\fr02         h123_frf67_rk_20140328.txt

%DRIVE_NAME%: is mapped drive.

Folders will be the same; not more than 100 folders and their sub-folders, and there will only be 2 or 3 files at time in any one of the folders.

Now the issues is that for one folder it works perfect, but for 80 to 90 folders it is taking too much time.

I think it's because of findstr and the different extensions used. Is there any way to make it faster?

© Super User or respective owner

Related posts about batch

Related posts about findstr