Directory Listing

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
 
B

billious

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.
 
F

foxidrive

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
)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top