Solved

Getting Back 'SHELL' Results after calling

Posted on 1998-09-08
2
146 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
[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 Comments
 
LVL 12

Accepted Solution

by:
fulscher earned 10 total points
ID: 1433665
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
ID: 1433666
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
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…
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…

740 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