Title: RE: How to avoid repeating commands?

And if your files are all in a given directory, or if you have a way to segregate them from others in the same location, you can use the foreach task with File in the item attribute, as follows :

<foreach item="File" property="filename">
        <in>
                <items>
                        <include name="MyRep/*MUSTBEREPLACED*.dll"/>
                </items>
        </in>
        <do>
            <exec program="regsvr32" workingdir="C:\Windows\System32\"
                commandline="${'/s /u '+filename}" failonerror="false" />
            <vssget
              dbpath="\\someserver\data\dev\software\source\vss\srcsafe.ini"
              username="${sourcesafe.username}"
              password="${sourcesafe.password}"
              path="${'$/VCpp/DLL/kcsStream/Bin/'+filename}"
              localpath="C:\Windows\System32"
              replace="true"
            />
            <exec program="regsvr32" workingdir="C:\Windows\System32\"
                commandline="${'/s '+filename}" />
        </do>
</foreach>

JP

PS : I hope my characters will display correctly in the digest. I have been struggling with Outlook in the last days, switching to the 'raw text' option, changing the endoding, etc. but without success...

------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to