Shell from Timer.Elapsed in Windows Service?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have a Windows Service with a timer that use the .NET 2.0 Shell command.
The Shell command returns a non-zero number but Task Manager shows the
shelled exe running but there is NO visible interface (there should be
one) -- I pass AppWinStyle.NormalFocus.

If I execute the exact same in a Windows form test app, the Shell works
flawlessly.

I've tried Diagnostics.Process approach rather than Shell but have the same
results -- my app appears to run but with no visible interface??

If I run my shelled app stand alone it works fine.

Is there some kinda bizarre problem with Shell or Diagnostics.Process where
it can't be executed in timer.elapsed event due to some threading conflicts
or something? Shell is asynchronous (not wait or timeout value set) so I
don't think this would be any issue at all.

I've done the usual diagnostics and put in trace code that is logged to my
event log and following execution of both my service code and shelled app --
all indicates functioning correctly, just no visible interface (form will
not show). Like I said for Shell I've got AppWinStyle.NormalFocus and for
the Diagnostics.Process approach I set StartInfo.WindowStyle =
ProcesssWindowStyle.Normal.

I'm at a complete stand still -- Any suggestions?

Rob.


.



Relevant Pages

  • Re: Best way to wait politely
    ... Do While lngCnt < lngRequired ... Doevents loop waiting for the lngAppPID, returned from shell, to no ... before the shelled app exits) wait for the shelled app to exit. ...
    (microsoft.public.vb.general.discussion)
  • Best way to wait politely
    ... I have a function that calls a lengthy external process in a loop as ... Do While lngCnt < lngRequired ... Doevents loop waiting for the lngAppPID, returned from shell, to no ... before the shelled app exits) wait for the shelled app to exit. ...
    (microsoft.public.vb.general.discussion)
  • Re: Best way to wait politely
    ...     Do While ProcessIsRunning ... Doevents loop waiting for the lngAppPID, returned from shell, to no ... work while the shelled app is running and then (assuming I finish ...
    (microsoft.public.vb.general.discussion)
  • Re: Best way to wait politely
    ... external function is), would be to call the function from an ActiveX ... Do While lngCnt < lngRequired ... Doevents loop waiting for the lngAppPID, returned from shell, to no ... work while the shelled app is running and then (assuming I finish ...
    (microsoft.public.vb.general.discussion)
  • Re: Shell MSDE setup problem
    ... > I am trying to use the Shell command to run the MSDE setup. ... > the shell command isn't allowing the shelled app to launch another process ...
    (microsoft.public.dotnet.languages.vb)