?
Solved

write string to running program

Posted on 2000-02-26
6
Medium Priority
?
148 Views
Last Modified: 2010-05-02
Hello Experts!!

I have a simple question;

I make use of a Windows-DOS program, and needs to send a string to that program, like "add user brian". How can I do that? I work in VB5_pro.

I expect that I have to make use of SENDKEYS, but how do I call the right program. Not shell - since I do not want to execute the program, it is already running.

Can some one help with this question?

Thank you!

/Jens*

0
Comment
Question by:Jens979
6 Comments
 

Expert Comment

by:jhedlund
ID: 2561419
Do you have access to the code of the program you wish to receive the message (the Windows/DOS one)?  If so, you could have it constantly reading a file that another one writes commands to.  Or look into DCOM.

If you do not have access to the code, you may not be able to send a message to the other program.  How does the other program work?  Command line arguments?  Can't you stop that program and reload it?
0
 
LVL 5

Accepted Solution

by:
KDivad earned 225 total points
ID: 2561460
SendKeys can't send text to a DOS window, but there is a work-around that usually works just fine.
(Note: DOS app may need to be running in a window instead of full-screen for this to work)

Try:

Appactivate Caption_Of_Window_To_Activate, True
ClipBoard.SetText Text_To_Send, vbCFText
SendKeys "% ", True
SendKeys "ep", True

Hope this helps!
0
 
LVL 1

Expert Comment

by:Maquiavelo
ID: 2561570
 Very clever KDivad!!!
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 3

Expert Comment

by:fibdev
ID: 2561684
kudos kDivad
0
 
LVL 5

Expert Comment

by:KDivad
ID: 2562285
Thanks! Let's see if Jens agrees...
0
 

Author Comment

by:Jens979
ID: 2567619
Well I could not get it working, tried a little, but then found out another way. Seems there is a commandline thing included with my server that this was for ~:\

Anyway I grade KDivad. But thanks to you all experts!

/Jens*
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

839 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