Solved

Getting Back 'SHELL' Results after calling

Posted on 1998-09-08
2
142 Views
Last Modified: 2010-04-30
Is there a way to get back the output of an executed program that is run by VB's SHELL funciton?  I could easily make the executed program store its results into an output file ie. "> output.txt" and just read in this file but i was hoping that the shell function would return back these results that were displayed on the stdout (the screen).  

The shelled program is a dos running program that just displays text on screen.
0
Comment
Question by:aniston
2 Comments
 
LVL 12

Accepted Solution

by:
fulscher earned 10 total points
Comment Utility
You can't. Your only option (with NT) would be to open a pipe and run your command sending the output to this pipe. This won't work generally though; redirected console output of MS-DOS apps is saved in a temporaray file and sent to the next program in the chain by using input redirection.

Shell returns a handle on the calling program. You can just check whether the program is still running but you can't get the output.
0
 
LVL 12

Expert Comment

by:mark2150
Comment Utility
If you don't have the "Close on Exit" option set on your programs properties page the DOS  window will remain open until you click on the [X] even though the program itself has stopped running. This allows you to read the screen prior to closeout.

M

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 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