Solved

How to send <Enter> key to DOS windows?

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…

785 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