Process.Start in a windows service

D

Daniel Reber

I am trying to start a process from a windows service but when the process
starts the command window that the process runs in never shows. Is this
because I am calling it from a windows service? Is there something else
that I need to do?

Here is my code:

System.Diagnostics.ProcessStartInfo info = new
System.Diagnostics.ProcessStartInfo();

info.FileName = "DTSRun";
info.Arguments = server.ExeSyntax; //Arguments for dtsrun
info.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
System.Diagnostics.Process.Start(info);


Thanks

Dan Reber
 
D

Daniel Reber

That worked, thanks. What kind of holes? Is there any other way for a
windows service to start an executable that has UI?

Thanks for your help.

Dan.
 
W

Willy Denoyette [MVP]

Daniel Reber said:
I am trying to start a process from a windows service but when the process
starts the command window that the process runs in never shows. Is this
because I am calling it from a windows service? Is there something else
that I need to do?


This because the Service runs in the context of a non interactive desktop,
if you start another process froms this parent process, the child will run
in the same non visible desktop.

What you could do (but I hate the idea because it opens a security hole as
big as the Ozon hole), is to set the service to interact with the desktop.



Willy.
 
W

Willy Denoyette [MVP]

Daniel Reber said:
That worked, thanks. What kind of holes? Is there any other way for a
windows service to start an executable that has UI?
A lot of info can be found on MSDN about security and elevating security
privileges when running services in the interactive winstation ( start with
KB Q327618).



Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top