Just use Powershell, which is preinstalled on Windows 7.
Powershell is capable of running cmd commands and does understand wildcards at any place in a path.
To start Powershell just type "powershell" in your start menu search box and hit enter.
In case the application expects a string with all filenames in it this is the right script:
$delimiter = " "
[string]$files = $nothing ; ls *.txt | % { $files += $_.fullname + $delimiter } ; application.exe $files
Change $delimiter = " " to $delimiter = "," if your application expects a comma separated list of file names.
Explanation of code:
[string]$files = $nothing - creates an empty variable of type
string ; - is a separator for multiple commands, not a pipeline!
ls *.txt | % { $files += $_.fullname + $delimiter } - gets a list of all text files and creates a string with all filenames separated by the delimiter
application.exe $files - calls the application and passes the file list to it
You can even search for a file pattern recursively by adding -recurse to ls *.txt so the complete code would look like this:
$delimiter = " "
[string]$files = $nothing ; ls *.txt -recurse | % { $files += $_.fullname + $delimiter } ; application.exe $files
Edit:
To avoid irritations, ls and dir are aliases of Get-ChildItem and % is an alias to ForEach-Object. I keep my code with aliases used because it's shorter.
I suspect the answer will be no, but has anyone dealt with this or come up with any way to make this easier?Actually, I’m having the opposite problem, I am trying to figure out a way to get the command-interpreter to treat its list as strings and prevent it from inreptreting them as wildcards. For example,for %i in (foobar baz really?) do @echo %iwill treat the last item (really?) as a filename wildcard, and skip it if there are no files namedreally1,reallyz, etc. ☹ – Synetech Feb 4 at 18:19