Solved

sending commands to running dos application

Posted on 2004-09-22
3
903 Views
Last Modified: 2009-12-16
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
"csm_tool"
"HA c:\outfile.txt"
<set to output to text file>
"s"
<prints text i need here>
"q"
<exits>

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
0
Comment
Question by:fcisler
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
LRHGuy earned 250 total points
ID: 12125553
You can try something like this:

Create a file inp.txt with two lines:

s
q


Then start the program like this:

csm_tool < inp.txt

It might work...
0
 
LVL 7

Expert Comment

by:LRHGuy
ID: 12125580
To expound further, the inp.txt file should have everything you would normally enter.

So, you could create a batch file:

gocsm.bat

with:

csm_tool < inp.txt

and in inp.txt put:

HA c:\outfile.txt
s
q


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.
0
 
LVL 1

Author Comment

by:fcisler
ID: 12125768
LRHGuy,

thank you very much....dunno why i didn't think to try that....
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DOS Database Program in Windows 10 5 124
how to pick file up from ftp via batch file 2 67
Windows updates batch files 7 68
How to remove unwanted words? 34 48
The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question