Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

You can use this:

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


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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .