views:

21

answers:

2

I have an executable file - process.exe - which takes a single file path and does something with that file (no outputs). process.exe isn't capable of accepting wildcard paths e.g. process.exe c:\project\*.ext

What I want to do is select all files of a particular extension in my project (*.xmlt) and pass each one of these files into the process.exe as part of my AfterBuild step.

+2  A: 

You'll have to use batching like this (in your project file):

<PropertyGroup>
  <ProcessExe>process.exe</ProcessExe>
</PropertyGroup>

<Target Name="AfterBuild">
  <ItemGroup>
    <Xmlt Include="**\*.xmlt"/>
  </ItemGroup>

  <Exec Command="$(ProcessExe) %(Xmlt.FullPath)"/>
</Target>
madgnome
A: 

You could use a command like the following

for %f in (*.xmlt) do process.exe %f

(you may need to use the full path instead of the local path)

vc 74