Solved

How to send <Enter> key to DOS windows?

Posted on 1998-11-17
2
798 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now