473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 6429
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.