# DOS Search Tool



## spackler (Mar 9, 1999)

Does anyone know of a DOS search util? I have a situation where I'm missing a file and can only get to the command line of the os (WinME) with a boot disk and need to find a file but I don't have time to search the entire machine - I've already looked in the places that I thought it was and I cannot find it - but I know the file is there.


I've looked through this forum, download.com and the MS "lack of" knowledge base and didn't find anything.

Many thanks.


----------



## pvc9 (Jul 7, 2002)

Hi,
See if this command helps -

*dir/s filename.extension* [enter]

eg. if you are searching for a file by name 1.txt which is actually present in C:\Windows\Desktop, then -

C:\>dir/s 1.txt [enter]

This will show you the path of the file.

Try that and get back.


----------



## MacFromOK (Mar 19, 2001)

Here's a batch file I use to search in DOS
that uses the DIR commands (also finds
hidden files), and let's ya display them one
page at a time if desired.

Save it (as text) to: C:\LOOKY.BAT
Then type *looky* at a DOS prompt for
instructions.

```
@ECHO OFF
if "%1"=="" goto error
if "%1"=="dir" goto DIR
goto FILES

:ERROR
  echo.
  echo  Use: "looky [filename]" to search current and subdirs for a file.
  echo       "looky dir [dirname]" to search current and subdirs for directory(s).
  echo.
  echo  NOTE: OK to use wildcards and/or "/p" switch for page at a time.
  echo        Uses DOS DIR command (includes hidden files).
  echo        Searches current and subdirs either way.
  echo.
  goto END

:FILES
  cls
  echo -------------- Searching for "%1 %2" files(s) as NORMAL files --------------
  dir /b /s /a:-d-h %1 %2
  if "%1"=="/p" pause
  if "%2"=="/p" pause
  echo -------------- Searching for "%1 %2" files(s) as HIDDEN files --------------
  dir /b /s /a:-dh %1 %2
  goto END

:DIR
  cls
  echo ----------------- Searching for "%2 %3" dir(s) as  NORMAL ------------------
  dir /b /s /a:d-h %2 %3
  if "%2"=="/p" pause
  if "%3"=="/p" pause
  echo ----------------- Searching for "%2 %3" dir(s) as  HIDDEN ------------------
  dir /b /s /a:dh %2 %3
  goto END

:END
  echo.
```
Cheers, Mac


----------



## pvc9 (Jul 7, 2002)

Mac,
That was a good one. Nice alternate to the dir/s command.


----------



## MacFromOK (Mar 19, 2001)

______________________________________________
Thanks PVC. 

Lol, sorry for the goofy name, but at the time LOOK,
FIND, and anything else I could easily remember was
taken...  

Cheers, Mac


----------



## pvc9 (Jul 7, 2002)

Thats not a problem. Its a small command too. So easy to use.


----------

