Take the 2-minute tour ×

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


$ 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?

share|improve this question
add comment

2 Answers

You can use this:

app.exe (dir *.ext)
share|improve this answer
add comment


dir *.ext | app.exe $_

share|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
add comment

Your Answer


