Its probably easiest if you have either a powershell command or batch file that 
wraps up all the actions you want to take. Then call that with your server 
parameter. Both batch files and powershell files can take input parameters.

Steven Nagy
Readify | Senior Developer
M: +61 404 044 513 | E: [email protected]<sip:[email protected]> | 
B: azure.snagy.name<http://azure.snagy.name/>

________________________________
From: [email protected] [[email protected]] On Behalf Of Oscar 
Bautista [[email protected]]
Sent: 19 May 2010 01:16
To: ozTFS
Subject: Run Multiple Commands Inside One Exec Task

Hi again.  Any thoughts on this one:

Is there a way to run multiple commands inside one Exec Task?  For example see 
below.  I create an ItemGroup to hold multiple Server names.  This is used in 
the Exec Command.  The EXEC Command executes the number of Servers (or Items I 
have).  I also need to call a .bat file inside the loop.  So the EXEC Command 
needs to do the "DoSomeProcess" and then call the .bat file (inside the loop).  
In the example below I would need only 2 iterations (since there are only 2 
servers in the ItemGroup).

1st Iteration:  \\ABC "DoSomeProcess" and then \\ABC "c:\example.bat"
2nd Iteration:  \\DEF "DoSomeProcess" and then \\DEF "c:\example.bat"

<ItemGroup>
  <Servers include="item">
    <Server>ABC</Server>
  </Servers>
  <Servers include="item">
      <Server>DEF</Server>
  </Servers>
</ItemGroup>

<Target Name="target1" Outputs="%("Servers.Identity")>
  <CreateProperty Value="%(Servers.Server)">
    <Output TaskParameter="Value" PropertyName="ServerName">
  </CreateProperty>
  <Exec Command="PSEXEC \\$(ServerName) "DoSomeProcess" Command="PSEXEC 
\\$(ServerName) "c:\example.bat"/>
</Target>

The Exec Command I show above will not work.  I cannot have 2 Commands inside 
the Exec Task.  How can I accomplish this?  Any thoughts or suggestions are 
very much appreciated.

Thanks,
Oscar Bautista
_______________________________________________
oztfs mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/oztfs

Reply via email to