[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 608
  • Last Modified:

BAT file to search a mapped directory


I need to create a bat file that will allow a user to enter a name or part of a name and then have it search the mapped drive and open the result.

Is this even possible. I know search would do that, but I am looking for something faster.

Any ideas?
1 Solution
@echo off
set /p filename="Enter name of file: "
set /p drive="Enter Drive (Q:, or Z:) to search for file: "

Rem assume that the user enter filename and drive correctly
cd \
dir /b /s | find "%filename%"

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now