Hi, nant's exec task waits until program terminates to check the returned exit code to fail when exit code <> 0.
Please add span="true" to exec task then it will work. You can use "pidproperty" to get the process id when you want to save it for stopping the webserver at the end of your script. (IMHO you will need some external tools like sysinternals pskill.exe for that) But you don't need cmd.exe here. You can start it directly: <target name="start"> <exec program="C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\WebDev.WebServer40.EXE" spawn="true" pidproperty="ws40.pid"> <arg line="/port:2864" /> <arg line="/path:c:\webservices" /> </exec> <echo message="${ws40.pid}" /> </target> hth Dominik Am 16.09.2011 09:00, schrieb Rasmus Rasmussen: > Hello all, > > I have this task: > > <target name="start"> > <exec program="cmd.exe" workingdir="C:\Program Files\Common > Files\Microsoft Shared\DevServer\10.0"> > <arg line="/C" /> > <arg line="START" /> > <arg line="WebDev.WebServer40.EXE /port:2864 " /> > <arg line="/path:c:\webservices" /> > </exec> > </target> > > it successfully starts the devserver (have to stop it first though). The > problem is that nant does not terminate. Nant prints "BUILD SUCCEEDED > Total time: 4.1 seconds." but does not return. What can be wrong? > > If I start devserver from cmdline in same way, then control is given > back to cmd-window. > > Thanks, > Rasmus > > -- The answer to the great question of life, the universe and everything is 42 (Douglas Adams) ------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA http://p.sf.net/sfu/rim-devcon-copy2 _______________________________________________ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users