How to search a hard drive for a directory name using DOS

dos

Is there a way to find a file on the C: of a computer , using a DOS command, without having to CD to the root of the C: drive? I would like to do it using the DIR and the FINDSTR command only.

Ultimately, my goal is to search for a file and then store the parent directory name in a ENV variable without changing directories and hopefully without creating a temp file.

Best Answer

Have a look at How to find a file in MS-DOS.

dir *bob*.* /s 

See also List of DOS commands

Related Topic