472,982 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,982 software developers and data experts.

windows service with process.start()

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
6 6385
this problem occur on windows2003 only
Oct 3 '06 #2
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
2
by: Russ McDaniel | last post by:
Originally posted to microsoft.public.dotnet.distributed_apps with no response. Reposted here with additional thoughts. --- Hello, I'm writing a Windows service which performs some...
4
by: Daniel Reber | last post by:
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? ...
3
by: Jacob Crossley | last post by:
Hello all. We have about 10 Window's services that we wrote in c#. We use them to process row's that we have queued up in various SQL tables. The services seem to hang at least once in any given...
4
by: Kristof Despiere | last post by:
Suppose you have one domain, filled with a couple of users. What needs to be done now is I need to start a windows application from a webform by pressing a button on the webform (for example). ...
5
by: Andrew | last post by:
Hey all, Requesting help from the VB.Net gurus in here. I was given a task to write a Windows Service (VB.Net) that would run an external program, and if that program closed for any reason...
2
by: John David Thornton | last post by:
I've got a Windows Service class, and I put a System.Threading.Timer, and I've coded it as shown below. However, when I install the service and then start it in MMC, I get a peculiar message: ...
2
by: deko | last post by:
When to use a privileged user thread rather than a windows service? That's the question raised in a previous post . It was suggested that if the service needs to interact with a WinForms app...
4
by: Steven De Smet | last post by:
Hello, This is my first post. I searched on the internet for answers but I was unable to solve my problem. So I hope that you guy's can help me with my VB.NET problem I tried to create a...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.