• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
Shiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic