Monday, June 5, 2017

windows 7 - How to make a batch file to search all drives?

How can I get this batch file to read all physical and mapped drives? It works fine with C: but will not read any other drive.


@echo off
set filePath=
for /R c:\ /d %%a in (*) do if exist "%%a\FileName" set filePath=%%a& goto continue
:continue
if defined filePath echo %COMPUTERNAME% %username% yes >> \\server\%computername%.txt

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...