arrowSubscribe to receive Tips n Tricks directly to your Inbox | FOLLOW US ON TWITTER | FACEBOOK FAN PAGE

 

Search and Log files with same extension under a directory | Command Prompt

Here is a trick to search files with similar extensions(say .txt) under a particular directory using Command Prompt.

Follow these steps:
  1. StartRun → type cmdOK, you will see the following screen.
  2. Go to the directory where you want to search files here the directory is F: drive, now type:

    dir *.txt /s /b > TextFiles.txt

    This command line will create a file called TextFiles.txt. This file will have a list of all the files in that directory and all subdirectories with the .txt extension. You can then open up this file in any text editor and operate on it. and also By changing the txt part, you can select different files. For example, if you wanted to list all of the PDF documents, just type:

    dir *.pdf /s /b > PDFFiles.txt
(You can use any extension for example for image files try *.jpg instead of *.txt
and ImageFiles.txt intstead of TextFiles.txt)

Leave your Comments....

0 comments »

Leave your response!