finding drive and directory path...

Microsoft XP
September 29, 2011 at 12:17:23
Specs: Windows XP, Intel
I want to search list of drives (ex C:\ , D:\ etc..) on a computer and once i got the drives i want to seach a directory path in all those drives. Once i found the drive and path, then i want to go inside the path and open a txt file to replace a line content.

could some one please help me on it.

i tried to find some help on it, i got the command "fsutil fsinfo drives" which prints the dirves on my box, but how to loop through the drives to find a path which exists in one of them...

See More: finding drive and directory path...

Report •

September 29, 2011 at 12:33:14
@echo off

REM using that fsutil command to load the drives into file for later use

fsutil fsinfo drives > drives.tmp

REM modify drives.tmp to remove the label at the beginning of the line

set /p str=<drives.tmp
set str=%str:Drives: =%
echo %str% > drives.tmp

REM now drives.tmp contains just the drive letters so you can loop through them

for /f "tokens=* delims= " %%A in (drives.tmp) do (

I'll continue this later ... can't finish now.

Report •
Related Solutions

Ask Question