Directory Listing

  • Thread starter Thread starter Justin Fancy
  • Start date Start date
J

Justin Fancy

Hi Everyone,

I need a command that will produce me all .ASP files in a specific
directory that also have the file "webconfig.asax" contained within the
folder. I know the "dir" command will generate me a list but i'm not
sure about narrowing it down the way I want it to.

Justin
 
Justin Fancy said:
Hi Everyone,

I need a command that will produce me all .ASP files in a specific
directory that also have the file "webconfig.asax" contained within the
folder. I know the "dir" command will generate me a list but i'm not
sure about narrowing it down the way I want it to.

Justin

Oh poor princess!


----- batch begins -------
[1]@echo off
[2]for /f %%i in ( ' dir /s /b /a-d ".\reltree\webconfig.asax" ' ) do if
exist "%%~dpi*.asp" dir "%%~dpi*.asp"
------ batch ends --------

Lines start [number] - any lines not starting [number] have been wrapped
and should be rejoined. The [number] that starts the line should be removed
The spaces surrounding the single-quotes are for emphasis only. The SPACES
are not required but the single-quotes ARE required.

..\reltree
is the relative root of the tree to search.
 
I need a command that will produce me all .ASP files in a specific
directory that also have the file "webconfig.asax" contained within the
folder. I know the "dir" command will generate me a list but i'm not
sure about narrowing it down the way I want it to.

This is untested:


@echo off
for /f "delims=" %%a in ('dir "c:\webconfig.asax" /b /s /a-d') do (
dir "%%~dpa\*.asp" /b /s /a-d >>file.log
)
 
Back
Top