Solved

How to send <Enter> key to DOS windows?

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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.
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…

708 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

14 Experts available now in Live!

Get 1:1 Help Now