Solved

Getting Back 'SHELL' Results after calling

Posted on 1998-09-08
2
143 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access 2016 VB code 9 102
DIR issue 7 50
Saving history changes to sub form 4 36
vb6, excel Run-time error 1004 method 'close' of object 'workbooks' failed 7 43
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

911 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

21 Experts available now in Live!

Get 1:1 Help Now