?
Solved

write string to running program

Posted on 2000-02-26
6
Medium Priority
?
146 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month9 days, 17 hours left to enroll

762 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