Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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