Jason,
This way works well too. The advantage of using args is that they will be
quoted if they have spaces.
so <exec program="echo" commmandline="hello c:\program files\file1.txt"/>
results in
>echo hello c:\program files\file1.txt
<exec program="echo">
<arg name="hello"/>
<arg name="c:\program files\file1.txt"/>
</exec>
results in
>echo hello "c:\program files\file1.txt"
----- Original Message -----
From: "Morris, Jason" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 21, 2003 10:17 AM
Subject: RE: [nant-dev] Problem with exec task and CMD/BAT files?
> Aaron,
>
> Try structuring your <exec> task using <arg>'s
>
> For example,
>
> <target name="build-database" description="Install the database using
> the CMD File">
>
> <exec verbose="true" basedir="${project.base.dir}"
> program="${commandfile.name}">
> <arg value="${sqlserver.name}" />
> <arg value="${database.name}" />
> </exec>
>
> </target>
>
> I think that I have seen this done, but I haven't done it myself. Don't
> know if this helps.
>
> Jason
>
>
> -----Original Message-----
> From: Sansone, Aaron [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 20, 2003 12:38 PM
> To: Nant-Developers (E-mail)
> Subject: [nant-dev] Problem with exec task and CMD/BAT files?
>
>
> I am having difficulty getting a CMD file to execute with NAnt. I'm
> using Win2000 and I have specified the following:
>
> <property name="project.base.dir"
> value="C:\Projects\Reference_Database"/>
> <property name="sqlserver.name" value="localhost\VSdotNET"/> <property
> name="database.name" value="Reference"/> <property
> name="commandfile.name" value="Create_Reference_Database.cmd"/>
>
> <target name="build-database" description="Install the database using
> the CMD File">
> <exec verbose="true" basedir="${project.base.dir}"
> program="${commandfile.name}" commandline="${sqlserver.name}
> ${database.name}" timeout="30"/> </target>
>
> The CMD File (which is like a batch file) will not execute and hangs
> with the following lines:
>
> build-database:
> [exec] C:\Projects\Reference_Database\Create_Reference_Database.cmd
> localhost\VSdotNET Reference
> [exec]
> C:\Projects\Reference_Database>C:\Projects\Reference_Database\Create_Ref
> erence_D
> atabase.cmd localhost\VSdotNET Reference
>
> I can manually run the cmd from a command prompt and it executes without
> a problem.
>
> I've tried renaming it to a .bat file and I have the same problem.
>
> Thanks,
>
> -Aaron
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you
> planning your Web Server Security? Click here to get a FREE Thawte SSL
> guide and find the answers to all your SSL security issues.
> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
> _______________________________________________
> Nant-developers mailing list [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/nant-developers
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Scholarships for Techies!
> Can't afford IT training? All 2003 ictp students receive scholarships.
> Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
> www.ictp.com/training/sourceforge.asp
> _______________________________________________
> Nant-developers mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/nant-developers
>
>
-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers