Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

write string to running program

Posted on 2000-02-26
6
Medium Priority
?
147 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
Industry Leaders: 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

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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

618 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