Author Topic: Batch file to interact with running dos application  (Read 2454 times)

0 Members and 1 Guest are viewing this topic.

MikeJuszkie

  • Guest
Batch file to interact with running dos application
« on: March 14, 2014, 05:24:16 pm »
I am working on a project and I was given a folder containing a application and a batch script that runs the dos application. The application takes two inputs. is there anything i can add to the script to have the script complete the two prompts in the application? I have tried echo and piping it to the application neither worked.
 

Offline zimzom

  • Regular Contributor
  • *
  • Posts: 63
  • Country: ph
Re: Batch file to interact with running dos application
« Reply #1 on: March 14, 2014, 05:54:39 pm »
did you try using expects?
 

Online calzap

  • Frequent Contributor
  • **
  • Posts: 509
  • Country: us
Re: Batch file to interact with running dos application
« Reply #2 on: March 16, 2014, 04:18:25 pm »
Mike,

Your question is not entirely clear.  Where are the inputs/prompts coming from? Keyboard, application already running, application that needs to be started, pointing device, A/D board or ??  What type or version of DOS is being used?  pre-windows ... what version and what company (IBM or MS or ?) or Windows command line??  An example of the code you've tried so far would help too.
There are lots of resource and utility programs available.  Books by Peat and Wolverton (different books) and websites like www.robvanderwoude.com.

Mike in California
 

Offline I_may_be_drunk_right_now

  • Contributor
  • Posts: 32
  • Country: ca
Re: Batch file to interact with running dos application
« Reply #3 on: March 17, 2014, 02:05:38 am »
I am working on a project and I was given a folder containing a application and a batch script that runs the dos application. The application takes two inputs. is there anything i can add to the script to have the script complete the two prompts in the application? I have tried echo and piping it to the application neither worked.

Oh, you want the batch file to send commands to the application while the application is running? Like typing in information and pressing enter? You have to find out if your application has a switch to allow that. In other words, at the command prompt, you need to type something like

applicationname.exe /?

and see if it gives you a little help. In DOS it's not as rich and functional as Unix/Linux unfortunately. You might have to get all greasy and dirty and work with little horrors known as TSR programs to do what you want....

But if you are working in windows, you can find software that simulates mouse and keyboard inputs to any application, but then you're not in a batch file anymore.

Tell us more, are the applications custom? Do you have the source code?

I wonder if Windows Powershell could help?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf