[program-l] VB.NET and Shelling in General

  • From: David Lant <david.lant@xxxxxxxxxxxx>
  • To: "Program-L List (Program-L@xxxxxxxxxxxxx)" <Program-L@xxxxxxxxxxxxx>
  • Date: Thu, 8 Sep 2005 11:56:50 +0100

Hi folks,

I'm looking at using a Shell function to invoke a legacy VB6 application to
run unattended on a server.  The process which will call this legacy app is
a VB.NET Windows service.

What I'm wondering is, is there a way for the calling process to determine
whether the legacy app has raised a runtime error?  I know the Shell
function allows me to wait until the process has completed, and also returns
the ProcID if the process is still running, such as when the timeout
expires.  But this would seem that I can only tell whether the process has
stopped running or not, and not whether it actually finished what it was
doing successfully.

I have seen the System.Diagnostics.Process class in the .NET framework, and
this does look like it might let me inspect any error output from the
invoked legacy app.  But as it's very new to me, and ever so slightly scary,
I'm hoping I could achieve what I want just by using the Shell function.
<smile>

Also, in general terms, when an executable is invoked using a Shell
function, does the .exe file get released once the program has finished?  Or
does it remain in memory until the calling process ends?  If the latter,
then it means my Windows service would lock the executable file after the
first time it was invoked, and never release it.

All thoughts welcomed.

David Lant

I.T. Consultant 
Consultancy & Development
ICT Services
Tel: (01392) 382464

Devon County Council accepts no legal responsibility for the contents of
this message. The views expressed do not reflect those of Devon County
Council.

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: