Windows Service - Accessing User's Desktop

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I've developed a Windows Service that acts as a remoting server (.NET
Remoting). The client(user) is able to connect to the server and start a
program by giving the executable path of the program (in the server) along
with the working directory and the arguments (parameters).
This works fine if I try to start programs whose executable file is present
witin the local drives of the server. If the application is in a netwok
drive, the Windows Service is not able to find it.
I found that: if the Windows service is running under the SYSTEM account,
then it won't be able to access the network drives. If the service is running
under the user's account, then it will be able to access the network srives.
No, the problem is: if the service runs under the user's account, the
application that the services starts cannot access the user's desktop. Now,
can anyone please help me to findout how can my windows service access the
user's desktop so that the invoked application can show up it's window to the
user?

Thanks
Bijesh
 
Bijesh,

When you go to the properties of the service, there is a checkbox that
you need to select to allow the service to interact with the desktop.
However, this can be a really bad idea, since it is not always guaranteed
that you will have an interactive login session available (meaning no
desktop to show to).

Hope this helps.
 
Bijesh said:
Hi All,

I've developed a Windows Service that acts as a remoting server (.NET
Remoting). The client(user) is able to connect to the server and start a
program by giving the executable path of the program (in the server) along
with the working directory and the arguments (parameters).
This works fine if I try to start programs whose executable file is
present
witin the local drives of the server. If the application is in a netwok
drive, the Windows Service is not able to find it.
I found that: if the Windows service is running under the SYSTEM account,
then it won't be able to access the network drives. If the service is
running
under the user's account, then it will be able to access the network
srives.
No, the problem is: if the service runs under the user's account, the
application that the services starts cannot access the user's desktop.
Now,
can anyone please help me to findout how can my windows service access the
user's desktop so that the invoked application can show up it's window to
the
user?

Thanks
Bijesh

You can't, only SYSTEM can be used to access the Desktop and this is only to
support debugging. Regular Services should not interact with the desktop and
they should not start interactive applications either.

Willy.
 
Nicholas Paldino said:
Bijesh,

When you go to the properties of the service, there is a checkbox that
you need to select to allow the service to interact with the desktop.
However, this can be a really bad idea, since it is not always guaranteed
that you will have an interactive login session available (meaning no
desktop to show to).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Bijesh said:
Hi All,

I've developed a Windows Service that acts as a remoting server (.NET
Remoting). The client(user) is able to connect to the server and start a
program by giving the executable path of the program (in the server) along
with the working directory and the arguments (parameters).
This works fine if I try to start programs whose executable file is
present
witin the local drives of the server. If the application is in a netwok
drive, the Windows Service is not able to find it.
I found that: if the Windows service is running under the SYSTEM account,
then it won't be able to access the network drives. If the service is
running
under the user's account, then it will be able to access the network
srives.
No, the problem is: if the service runs under the user's account, the
application that the services starts cannot access the user's desktop.
Now,
can anyone please help me to findout how can my windows service access the
user's desktop so that the invoked application can show up it's window to
the
user?

Thanks
Bijesh
Hello,

The "Allow service to interact with desktop" option is available only for
system-accounts. But if I use the system-account, I'll not be able to access
the network drives. And in my case, I need to access the network drives.

Thanks You
Bijesh
 
Willy Denoyette said:
You can't, only SYSTEM can be used to access the Desktop and this is only to
support debugging. Regular Services should not interact with the desktop and
they should not start interactive applications either.

Willy.

Hello Willy,

So, is there any workaround instead of having a standalone application?

Thank You
Bijesh
 
Why do you need to start a "Windows" application on the server in the first
place, what if there is no interactice logon or what if there is no
interactice user?

Willy.
 
I'm developing a testing env. where the user can start one application on a
remote machine and the get notified when the application quits. And the user
should be able to see the application on the server (in case of any
error/exception etc.). This is the basic usecase.
 

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

Back
Top