How to search using MS-DOS.

Archive of the first decade of Off Topic Posts
Locked
User avatar
Blast!10
Rainbow Star
Posts: 1739
Joined: Thu Nov 02, 2006 7:26 pm
Location: New Hampshire

How to search using MS-DOS.

Post by Blast!10 » Mon Mar 01, 2010 1:02 pm

I believe many of you don't know about this trick, so I'll post it here.

First, open up CMD. To do this, the quickest way is to open up Start -> Run... and type in "cmd" without quotes.

Then, type in the following command:

Code: Select all

cd \
This will bring you to your main drive directory (in my case, C:\).

If you want to search your whole drive, leave it at the drive directory.
If you want to search a certain folder and its subdirectories, navigate to the desired directory using the cd command.
Some help:
cd <folder> - Brings you to the directory <folder>. e.g.: "cd webcam photos" or "cd webcam photos\photoshop"
cd .. - Brings you one level up.
cd \ - Brings you to the drive directory.

When you reach the directory you want to search in, type "dir /s <terms>", where <terms> is the term you want to search for. This can be a full file name, or a file name with fillers (asterisks).

Code: Select all

dir /s glob_mod.png
will output all instances of the file glob_mod.png in the chosen directory and all subdirectories.

Code: Select all

dir /s *art*.jpg
will output all instances of files that contain the word "art" before the extension and have the extension jpg in the chosen directory and all subdirectories.

Code: Select all

dir /s camera.*
will output all instances of files that have the main file name "camera" and any extension.

Code: Select all

dir /s *.gif
will output all instances of files that have the extension gif.

This is much faster and more powerful than the Windows search.
The only downside is that the search doesn't continue if you minimize the window.

Good luck! :D
User avatar
Blast!10
Rainbow Star
Posts: 1739
Joined: Thu Nov 02, 2006 7:26 pm
Location: New Hampshire

Post by Blast!10 » Tue Mar 02, 2010 4:41 pm

D-P

Here's an example of me searching for the file dat.gmk in My Documents and all subfolders.

Code: Select all

Microsoft Windows XP &#91;Version 5.1.2600&#93;
&#40;C&#41; Copyright 1985-2001 Microsoft Corp.

C&#58;\Documents and Settings\yuval>cd \

C&#58;\>cd documents and settings\yuval\my documents

C&#58;\Documents and Settings\yuval\My Documents>dir /s dat.gmk
 Volume in drive C has no label.
 Volume Serial Number is B42E-B97C

 Directory of C&#58;\Documents and Settings\yuval\My Documents\Games that require folders\Dat

08/02/2009  11&#58;05         2,149,154 dat.gmk
               1 File&#40;s&#41;      2,149,154 bytes

C&#58;\Documents and Settings\yuval\My Documents>
One thing I forgot is that you can press Ctrl+Break to terminate the search.
Locked