Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

You can use this:

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

Alternatively:

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

 
discard

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.