Hi all... I have a batch file to map a server to a "x" drive
Then to search folders called user1 user2... Upto user7,
This might get more directories over a few months etcetcFor a folder named after the user which I prompt to search for
Say bloggsp5 is the name...It searches user1 by the pushd command and popd back if not found
And pushd to the next folder...Then I have returned a echo saying bloggsp5 was found in section-IT\user4\...
Now my batch file is very very long and hard to look at
(have many "sections-agencies" ie... IT Or HR...)I hope this is understandable?
Can this be done in a for loop? That's my question,
instead of having a bat file ten miles long?Oh and I use CLIP.EXE to paste to clipboard to paste in notepad the findings...
I don't know if that can work also ?
:)
Break each section out into their own files and then CALL them when you need them from a "driver" batch script. Tony
I am (as usual) confused. Why can't you search from the root of X:\
is this a "permissions" issue? I am probably way out in left field, or maybe even absent from the ballpark, but here's a rough-edge for what I would do.@echo off & setlocal enabledelayedexpansion
for /f "tokens=*" %%a in ('dir /s /ad X:\*\user?\%1') do echo %%a
:endthis is assuming that bloggsp5 is a directory.
also, post your code...
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |