• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 931
  • Last Modified:

sending commands to running dos application

This seems to be the most appropriate place to ask this question, but if it's not feasable then i may have to do it under programming....but

We use filenet here for document management
Part of my job every day is to do this
start > run
"HA c:\outfile.txt"
<set to output to text file>
<prints text i need here>

it takes 5 minutes to do, and frankly i am lazy...i know i can automate it. Heres the problems and cavets though:

"csm_tool" does NOT support any command line arguments (and the vender dosent care what i think or ask, so it's out of the quetion)
i can have the exe inside print to a text file (which i am going to do and is ultimately my goal) through HA filename
if i do something like echo s | csm_tool then it goes into a loop....not sure why, yet if i do a echo q (quit) it dosent....i have no clue why it is looping until the program terminates....

so basically, i need to send HA file, then s, then q to a running dos program, or have a batch file do it for me.....is this possible? if not, i will move it over to a VB/C# forum and ask.....thanks
  • 2
1 Solution
You can try something like this:

Create a file inp.txt with two lines:


Then start the program like this:

csm_tool < inp.txt

It might work...
To expound further, the inp.txt file should have everything you would normally enter.

So, you could create a batch file:



csm_tool < inp.txt

and in inp.txt put:

HA c:\outfile.txt

That is, if I understand what you're trying to do. Some programs, though, don't accept input from the standard input, so the redirection might not work.
fcislerAuthor Commented:

thank you very much....dunno why i didn't think to try that....
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now