Advertisement

07.17.2007 at 01:49PM PDT, ID: 22702686
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.2

Starting a Process As Another User from a Windows Service

Asked by TheAvenger in C# Programming Language, .NET, .NET Framework 2.x

Tags:

Hello guys

I have a Windows service which is checking for some changes in a database and when they happen it has to open Microsoft Project. As Microsoft Project is a UI application I need the service to be allowed to interact with the desktop (a user is always logged in) so it must run under the local system account.

I succeed to start a UI application from the service, e.g. Notepad but it runs under the local system account as well which is not enough for Microsoft Project. I made impersontion with the local administrator before starting the new process but it does not help - the new process still runs under the local system account.

I googled a lot and I found 4 different solutions, none of which works:

1. Use LogonUser and then CreateProcessAsUser to start the new process: I get an error 1314, ERROR_PRIVILEGE_NOT_HELD, even when I try this as a Windows application

2. Process.Start with user data: works fine as a Windows application but fails with error 5, "Access is denied" when run as a Windows service (I am testing it with Notepad.exe, everyone has access there, even the local system account can run it)

3. CreateProcessWithLogonW with user data: works fine as a Windows application but fails with error 5, "Access is denied" when run as a Windows service

4. I found a class called RunAs in Code Project which is based on CreateProcessWithLogonW as well and acts exactly the same

Does anyone have a good idea how this could work? I would appreciate any addition to the multiple articles I already found which point the problem but never show a solution.

TheAvengerStart Free Trial
 
Loading Advertisement...
 
[+][-]07.17.2007 at 01:58PM PDT, ID: 19508921

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.17.2007 at 01:59PM PDT, ID: 19508928

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2007 at 02:02PM PDT, ID: 19508946

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2007 at 02:09PM PDT, ID: 19508989

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2007 at 02:10PM PDT, ID: 19508996

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.17.2007 at 02:12PM PDT, ID: 19509017

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2007 at 02:39PM PDT, ID: 19509163

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2007 at 06:10PM PDT, ID: 19510422

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C# Programming Language, .NET, .NET Framework 2.x
Tags: process
Sign Up Now!
Solution Provided By: mastoo
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.17.2007 at 11:06PM PDT, ID: 19511331

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2007 at 07:35AM PDT, ID: 19513912

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2007 at 07:41AM PDT, ID: 19513985

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2007 at 08:02AM PDT, ID: 19514236

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32