You are probably correct that the batch file is waiting for input from NAnt as
it does not seem that control has been properly passed to cmd.exe to accept
user input. I will explain what I need to do further to clarify why it is
desirable to use a bat file like this with NAnt.
I am designing a automated compilation script for an Oracle Forms and Reports
development environment containing numerous databases with associated projects.
As the username and password for connecting to the databases differs, and
because of organisational measures in place that require that developers are
not privy to the username and password for various databases (only DBA's have
these rights), the ideal solution is to prompt the user (whether it be
developer or DBA) for the username, password and database relevant to the files
they wish to have automatically compiled. As a bat file that achieves most of
this functionality has already been created, I was hoping to use that since I
have not learnt any of the scripting languages supported by NAnt and I am not
aware of any other way to achieve what I need. Do you have any suggestions for
how I can achieve what I need?
> Date: Sun, 18 Apr 2010 21:23:31 -0700
> Subject: Re: [NAnt-users] Running a bat file
> From: rmbo...@gmail.com
> To: yo...@live.com
> CC: nant-users@lists.sourceforge.net
>
> Hi,
>
> At first glance, the reason why it freezes is because it looks like
> the batch file is waiting for user input that NAnt isn't providing.
>
> I'm sorry, I have to ask. Why are you running a batch file from a
> NAnt build file? Seems like overkill to me, unless you have a
> specific need for it.
>
> Thanks,
> Ryan
>
> 2010/4/18 Simon H <yo...@live.com>:
> > Hi guys,
> >
> > I'm trying to run a bat file that displays a menu and accepts user input
> > from the commandline as input. To clarify, here is an excerpt of the bat
> > file:
> >
> > :topoffile
> > @echo off
> > @echo =================================================
> > @echo This is an Oracle Forms Compilation facility
> > @echo =================================================
> > @echo.
> >
> > :accountagain
> > @echo off
> > @echo Please enter Schema owner account and
> > set /p schemaowner=press return key, or QUIT to end:
> > if /i [%schemaowner%]==[QUIT] endlocal&goto end
> > @echo.
> > @echo =================================================
> > @echo Schema owner account entered was: '%schemaowner%'
> > @echo =================================================
> > if [%schemaowner%]==[] goto WrongAccount
> > @echo.
> >
> > In my nant build file I have the following target code:
> >
> > <target name="menu" description="display build menu">
> > <!-- password.bat is in the project basedir -->
> > <exec program="password.bat">
> > </target>
> >
> > However, when I run the build file I get the following output:
> >
> > menu:
> >
> > [exec] ♀♀=====================================
> > [exec] This is an Oracle Forms Compilation Facility
> > [exec] =======================================
> > [exec]
> > [exec] Please enter Schema owner account and
> >
> > The execution of the bat file stops/freezes and cmd.exe will not accept any
> > input and I have to Ctrl+C to return to the command prompt. How do I get
> > nant to correctly execute the bat file? Thanks in advance!
> >
> > ________________________________
> > Meet local singles online. Browse profiles for FREE!
> > ------------------------------------------------------------------------------
> > Download Intel® Parallel Studio Eval
> > Try the new software tools for yourself. Speed compiling, find bugs
> > proactively, and fine-tune applications for parallel performance.
> > See why Intel Parallel Studio got high marks during beta.
> > http://p.sf.net/sfu/intel-sw-dev
> > _______________________________________________
> > NAnt-users mailing list
> > NAnt-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/nant-users
> >
> >
_________________________________________________________________
New, Used, Demo, Dealer or Private? Find it at CarPoint.com.au
http://clk.atdmt.com/NMN/go/206222968/direct/01/
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users