arrays - need a batch to search in all available drives and display a file which is in one or more places -


need windows batch file search in available drives , display file in 1 or more places.

how below thing using array?

my scenario:

  1. check drive:/programfiles/test/config.xml in available drives(a,b,..z).
  2. if file exits in 1 or more place ,list discovered files in
    1. c:/programfiles/test/config.xml
    2. e:/programfiles/test/config.xml
      in way has check each , every drive , has display if file there.
  3. then have choose option list ie 2 use e:/programfiles/test/config.xml.

so should return me u have selected e:/programfiles/test/config.xml.

vijai k

you can iterate on lists of items for:

for %%d in (c d e f g h ... x y z) 

you can check file existing if exist filename:

if exist %%d:\programfiles\test\config.xml 

and use echo output text:

echo %%d:\programfiles\test\config.xml 

this should give enough write batch file yourself.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

c++ - End of file on pipe magic during open -