Command line help

Status
Not open for further replies.

hitesh_hg

Journeyman
here is what i wanna do and some how all in command prompt..

1. search for a file (dir filename.ext /s /b)
this gives output in the form of absolute path including the filename and no other crap e.g. c:\Program Files\wherever\filename.ext

now i wanna use the path(s) obtained above to view the content...
any ideas on how to do it??
i read DOS for dummies a long time back and there was some implementation..

actually i want to store all the command in a batch file and route the display (type ) to another file, all in the background...

thanks
Hitesh Gupta
 

Sykora

I see right through you.
You have to pipe it.

Code:
dir filename.ext /s /b | <whatever you want to do with the files>

You send the output of the first operation through the pipe to the second operation.
 

Rollercoaster

-The BlacKCoaT Operative-
do u want to view the contents of the filename.ext or the containing directory c:\Program Files\wherever\ ?


--to save the output of the command use "dir filename.ext /s /b > output.txt"
this will save all the output into the text file "output.txt"

you will have to use some kind of loops... try googling "dos loops"
 
Last edited:
Status
Not open for further replies.
Top Bottom