Without seeing the batch file, it is hard to say. Is it possible that your
batch file is hanging for path or timeout reasons? (BTW. I don't think the
timeout on exec actually works.)

Here is a simple sample I created to test with.

----echo.cmd----
@echo off
echo Command Line Args:
FOR %%a IN (%*) DO echo %%a

---cmd.build---
<?xml version="1.0" ?>
<project name="cmd" >
   <property name="sqlserver.name" value="localhost\VSdotNET"/>
   <property name="database.name" value="Reference"/>

   <exec
    verbose="true"
    basedir="."
    program="echo.cmd"
    commandline="${sqlserver.name} ${database.name}"
    timeout="30"
 />
</project>

I tested with the current version of nant that is in cvs.

The output was:

bin\nant -buildfile:c:\temp\cmd.xml
Buildfile: file:///c:/temp/cmd.xml
     [exec] c:\temp\echo.cmd localhost\VSdotNET Reference
     [exec] c:\temp>c:\temp\echo.cmd localhost\VSdotNET Reference
Command Line Args:
localhost\VSdotNET
Reference

BUILD SUCCEEDED

Total time: 0 seconds

----- Original Message -----
Sent: Monday, January 20, 2003 11:38 AM
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_Referen
ce_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.



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to