I would like to input all the filenames in the current directory after an application name, like so:

root\file1.ext
root\file2.ext
root\file3.ext

$ app.exe file1.ext file2.ext file3.ext

I could write a batch file that could do this automatically and add it to the PATH variable, which is an okay solution. But can PowerShell for example let me write a command like this on-the-fly?

link|improve this question
feedback

2 Answers

You can use this:

app.exe (dir *.ext)
link|improve this answer
feedback

Alternatively:

dir *.ext | app.exe $_

link|improve this answer
I don't think this can work. The $_ can only be used in a pipeline context 9i.e. a process block) – zdan Jul 16 '11 at 18:39
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.