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

  • From: "Mark Long" <Mark.Long@xxxxxxxxxxxxx>
  • To: <program-l@xxxxxxxxxxxxx>
  • Date: Thu, 8 Sep 2005 13:50:00 +0100

If I understand your question then the answer is yes.



-----Original Message-----
From: program-l-bounce@xxxxxxxxxxxxx
[mailto:program-l-bounce@xxxxxxxxxxxxx] On Behalf Of David Lant
Sent: 08 September 2005 13:48
To: 'program-l@xxxxxxxxxxxxx'
Subject: [program-l] Re: VB.NET and Shelling in General

Thanks Mark.

If the shelled app is an independent process, does that mean that the
file
is unloaded from memory when it finishes, and thus unlocks the .exe file
on
disc?

I'm liking the look of System.Diagnostics.Process, but sadly the
timescale
I've been given for my solution doesn't permit the necessary R&D I'd
need to
get it under my belt. *sigh*

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.


-----Original Message-----
From: Mark Long [mailto:Mark.Long@xxxxxxxxxxxxx] 
Sent: 08 September 2005 13:19
To: program-l@xxxxxxxxxxxxx
Subject: [program-l] Re: VB.NET and Shelling in General


When you shell an app, it is an independant process. It is pretty hard
to
know what happened to it. About all that you can tell is if it is still
running.

There is a VB6 sample at
http://support.microsoft.com/default.aspx?scid=kb;en-us;96844

The same is true in VB.NET as far as I am aware.

-----Original Message-----
From: program-l-bounce@xxxxxxxxxxxxx
[mailto:program-l-bounce@xxxxxxxxxxxxx]
On Behalf Of David Lant
Sent: 08 September 2005 11:57
To: Program-L List (Program-L@xxxxxxxxxxxxx)
Subject: [program-l] VB.NET and Shelling in General

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
** 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
** 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
** 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: