Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Problem running dos batch file

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a problem with one of my build scripts.

This is what I have in my script to run a batch file:



but when it runs, it gets to the following then stops and I am not able to key in anything to instruct the batch file to continue.

[echo] Patching up
[exec] Please shutdown Dynamo before running InstallPatch.
[exec] [Y] continue
[exec] [N] stop


Any ideas how I can work around this?
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ben, welcome to JavaRanch!

Quoting from the Ant manual, the exec task:

Note that you cannot interact with the forked program, the only way to send input to it is via the input and inputstring attributes.



This means that you must provide either an 'input' or an 'inputstring' attribute to the exec task, and that information will be then passed to the app that is run. In other words, you must provide canned input. Perhaps something like this:

 
Ben Dawson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the response, but unfortutnely this hasn't worked.

Any other sugestions?

Cheers
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This works for me:

batch.bat


build.xml


And the output from the run:


Note the response to the "Continue" question.
reply
    Bookmark Topic Watch Topic
  • New Topic