Solved

How to send <Enter> key to DOS windows?

Posted on 1998-11-17
2
801 Views
Last Modified: 2012-08-13
:)
I have a dos program executed from VB (using Shell )and the DOS prog will ask for a key to be entered before continuing. How can I send <Enter> key to the DOS program from VB?
Something like:

Shell ("myprog "),..
-- send enter key to myprog window ---???

Sorry but I am out of points!! Thanks a million.
0
Comment
Question by:Haho2
[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
  • 2
2 Comments
 
LVL 3

Accepted Solution

by:
vikiing earned 0 total points
ID: 1445343
Try to put the program into a .BAT file, in a sentence like this:

   ECHO.|your-program

The "ECHO." command (note the period stuck to letter "O") generates simply an ENTER, which is piped to "your-program". If "your-program" accepts redirected input, then it will work (of course, your VB program must SHELL to the .BAT file).
0
 
LVL 3

Expert Comment

by:vikiing
ID: 1445344
PS: note that the vertical bar which appears as joining ECHO to your-program, is the vertical bar that often appears above "\"; you can see what exactly is just by typing (at DOS level) Alt-124


0

Featured Post

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!

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

756 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