473,486 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Windows Service - Accessing User's Desktop

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

Nov 17 '05 #1
6 3030
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]
- mv*@spam.guard.caspershouse.com

"Bijesh" <Bi****@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
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

Nov 17 '05 #2

"Bijesh" <Bi****@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
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.
Nov 17 '05 #3

"Nicholas Paldino [.NET/C# MVP]" wrote:
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]
- mv*@spam.guard.caspershouse.com

"Bijesh" <Bi****@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
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

Nov 17 '05 #4


"Willy Denoyette [MVP]" wrote:

"Bijesh" <Bi****@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
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.


Hello Willy,

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

Thank You
Bijesh
Nov 17 '05 #5
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.

"Bijesh" <Bi****@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...


"Willy Denoyette [MVP]" wrote:

"Bijesh" <Bi****@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
> 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.


Hello Willy,

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

Thank You
Bijesh

Nov 17 '05 #6

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.

"Willy Denoyette [MVP]" wrote:
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.

"Bijesh" <Bi****@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...


"Willy Denoyette [MVP]" wrote:

"Bijesh" <Bi****@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
> 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.


Hello Willy,

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

Thank You
Bijesh


Nov 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
10271
by: Lalit | last post by:
Hi Friends, I have developed a Windows service. Now i need icon for this service in systray and context menu fo this icon. Can i do this? With regards, Lalit
1
5651
by: Artur Kowalski | last post by:
I have a NotifyIcon in my Windows Service project and I am trying to add a ContextMenu to this NotifyIcon or use some of the mouse events. Everything isn't working. I think so base class of the...
6
1931
by: Ian Frawley | last post by:
Hello everyone I have written a Windows Service to monitor local and remote Processes/Applications. However I am stuck because if it is installed as a user account I cannot get it to interact...
4
15493
by: Primo | last post by:
Hi, This problem has been frustrating me for days and I hope you experts can help me out. I am trying to run a command, which I would normally run from the command line, from within my C#...
1
2406
by: Hank | last post by:
I am writing a windows service in C#.NET which will manage image capturing devices, when client connects to the service, at some point the service need to expose a device dialog to the client for...
3
4580
by: Lubomir | last post by:
Hi, I read that interactive windows services will not be allowed to run under Wista. I would like to ask what exactly is the interactive service. It is supposed to be a service that communicates...
7
2374
by: Ahmed Perlom | last post by:
Hi all, I am trying to start a windows application that has a GUI from a Windows service written in .NET 2.0. I have been searching on this for few days now with no avail. When using the...
41
11586
by: pbd22 | last post by:
Hi. I know my windows service works when i run it in debug mode on my dev machine. It also works in release mode on my dev machine. But, when I move the service to a production server, it...
9
2310
by: dm3281 | last post by:
Hello -- I plan on writing a C# service using VS2005. If I want my service to have a tray icon, is this typically done from within my service or do/should I create a controller application and...
0
7099
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
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5430
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4864
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3069
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.