Solved

Getting Back 'SHELL' Results after calling

Posted on 1998-09-08
2
148 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

738 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