Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 595011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:00:57+00:00 2026-05-13T16:00:57+00:00

I was wondering if there is a simple way for a service to create

  • 0

I was wondering if there is a simple way for a service to create a process in user session?

My service is running as a user(administrator) account and not as a LocalSystem acount, therefore i can’t use the WTSQueryUserToken function.

i have tried calling

OpenProcessToken(GetCurrentProcess,TOKEN_ALL_ACCESS,TokenHandle);

but when i use this token to run

 CreateProcessAsUser(TokenHandle,.....)

my process is still running in session 0.
how can i resolve this issue?

I’m using an Ole automation so i don’t really care on which session the process will be running on, as long it is not the session 0 – because the Ole from some reason doesn’t create its processes (winword.exe for instance) in session 0, but rather it creates them in other user sessions.

Any suggestions will be welcome.
Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:00:57+00:00Added an answer on May 13, 2026 at 4:00 pm

    I Have been able to resolve this issue myself, thanks for all of those who have looked at this question.

    Ok, so as i mentioned above – the Token belongs to a process which is running in session 0…

    so what i have done…is looked for a token of a process that is not running in session 0.
    when you take it’s process id as the parameter for OpenProcessToken.
    than the CreateProcessAsUser will create the process in the same session (and probably with the same cridentals as the process you have chosen);

    The problem was that i couldn’t have get any details on most of the processes using the function: QueryFullProcessImageName – because it has a bug, and it doesn’t work on proccesses that are created from a path that contains spaces (like C:\Program files for instance)
    and another issue with that function i guess is that because i’m running the original process using a user cridentals i can’t access the information of a process that is running using the Local-system account. which is pretty bad because i wanted to take the winlogon.exe as my process (because it indicate a new opened session).

    also in order to succeeed in that trick, you must play a little bit with the security of the system, in order to allow the process to ask for elevated security:
    what i have chosen to get elevated for is :
    SeDebugPrivilege – for finding information on the running processes
    SeAssignPrimaryTokenPrivilege – in order to run a new process with the token i extracted from the user session process(i.e explorer.exe)
    SeCreateTokenPrivilege – i dont know if it is needed but i did it anyway because it sounds related.

    in order to succeed in elevating this Privileges – you must add the user that run the process to the relevant users in all of this Privileges in run->gpedit.msc or run->secpol.msc (under Local Computer Policy\Computer Configuration\ Windows Settings\Security settings\ LocalPolicies\User Rights Assignments)

    add your account to the following rights(compaitable with the Previleges above) :

    Create a token object
    Debug Programs
    Replace a Process level token

    and that is it! 🙂
    it has been working Great!
    Btw, you might want to disable all the UAC stuff…i dont know if it is related or not, but it has made the working with 2008 less painful – no more annoying popups.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering if there is a simple way to allow a JQuery datatable
I'm wondering if there's a simple way for a Word macro to determine which
Was wondering if there was a simple way to add and configure a POP3
I am wondering if there is simple way to ensure that: when a C#
I'm wondering if there is a simple way to store the path of a
I am wondering is there is a simple way to tail a file in
I am wondering if there is a simple snippet which converts links of any
I was wondering whether there is a simple PHP library to test the loading
I was wondering if there are any performance differences when using simple queries as:
Hai. I was making this simple string class and was wondering if there was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.