By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,057 Members | 1,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,057 IT Pros & Developers. It's quick & easy.

windows service with process.start()

P: n/a
I have a Windows service from which I want to start Internet Explorer with a
particular URL as an argument. I don't know why my code (shown below)
doesn't work. I know that IExplore.exe starts as I can see it in my task
manager, but it is not visible. Can anyone explain what is happening?

My code:
Process p = Process.Start("IExplore.exe", m_strURL);
Oct 3 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
this problem occur on windows2003 only
Oct 3 '06 #2

P: n/a
Hi,

"uuyytt" <uu****@hotmail.comwrote in message
news:eo**************@TK2MSFTNGP03.phx.gbl...
>I have a Windows service from which I want to start Internet Explorer with
a particular URL as an argument. I don't know why my code (shown below)
doesn't work. I know that IExplore.exe starts as I can see it in my task
manager, but it is not visible. Can anyone explain what is happening?

My code:
Process p = Process.Start("IExplore.exe", m_strURL);
NT Services do not have access to the interactive desktop by default.
Windows NT and above have the concept of window stations. Your logon session
has a window station and your service has its own. So they both have a
windows desktop of their own and you can only see yours. If your service
runs as local system you can use service control manager to give that
service access to the interactive desktop. So that might help but only for a
little while I guess because if you connect to that server with remote
desktop your remote session will live in just another window station.

My advice is to change your design. Split up your service's functionality to
start processes in another app which is run manually by the user. You might
add it to the startup group to get it auto started after a user logged in.
Then use some IPC mechanism (remoting, sockets, COM) to communicate between
your service and the user app, so that the service can tell your user app to
start some processes.

--
SvenC
Oct 3 '06 #3

P: n/a
I have the same problem with windows service. When i run
Process.Start("notepad.exe"), I cant open a notepad but I see the process is
running in task manager.

Event I allow services explicitly to interact with the desktop.

PS. This problem occur only on windows 2003
Oct 4 '06 #4

P: n/a
Hi,

"uuyytt" <uu****@hotmail.comwrote in message
news:uB**************@TK2MSFTNGP03.phx.gbl...
>I have the same problem with windows service. When i run
Process.Start("notepad.exe"), I cant open a notepad but I see the process
is running in task manager.

Event I allow services explicitly to interact with the desktop.

PS. This problem occur only on windows 2003
Are you seeing the server directly or with remote desktop client?
Please verify which session your logon is running in: Task
manager->Processes: Menu: View->Select Columens... "Session ID"

Both your service and your login session should be 0.

--
SvenC
Oct 4 '06 #5

P: n/a
I remote to desktop client and see both service has Session ID = 0.

I allowed services explicitly to interact with the desktop and
I tested with imporsonation but still not work.
Any idea?
Oct 4 '06 #6

P: n/a
Hi,

"uuyytt" <uu****@hotmail.comwrote in message
news:ek**************@TK2MSFTNGP02.phx.gbl...
>I remote to desktop client and see both service has Session ID = 0.
Both service? Do you have two services or do you mean your service and the
started application (e.g. IE or notepad) have both session 0?
If that is the case your started app will only be visible when you log on
directly at the console of the server where you also get to session 0. On
your remote session you could look up the session ID of explorer.exe which
will be 0.
I allowed services explicitly to interact with the desktop and
I tested with imporsonation but still not work.
You can try if you can connect with the command "mstsc /console" which
connects you to session 0. But only one user can connect to that session so
this does not work if more than one user uses the "app start feature" of
your service as all started apps will appear in session 0.

--
SvenC
Any idea?

Oct 5 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.