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 9030607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:31:58+00:00 2026-06-16T07:31:58+00:00

I’m somewhat confused about the proper way of calling CreateProcessAsUser with command line parameters.

  • 0

I’m somewhat confused about the proper way of calling CreateProcessAsUser with command line parameters. So without going into details of filling out the rest of its parameters, can someone confirm that this is how it should be done? (In other words, should I put the exe file path as the first command line parameter, or specifying it as lpApplicationName is enough?)

LPCTSTR pExePath = L"c:\\program files\\sub dir\\program.exe";
LPCTSTR pCmdLine = L"v=\"one two\"";

TCHAR buff[MAX_PATH];
StringCchCopy(buff, MAX_PATH, _T("\""));
StringCbCat(buff, MAX_PATH, pExePath);
StringCbCat(buff, MAX_PATH, _T("\" "));
StringCbCat(buff, MAX_PATH, pCmdLine);

CreateProcessAsUser(hToken, pExePath, buff, NULL, NULL, FALSE, dwFlags, NULL, NULL, &si, &pi);
  • 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-06-16T07:31:59+00:00Added an answer on June 16, 2026 at 7:31 am

    If 2nd param to CreateProcessAsUser is NULL, then the module name must be the first white space–delimited token in the 3rd param.

    If 2nd param to CreateProcessAsUser is not NULL, then it will be taken as the executable to execute. In this case, the 3rd param can either be

    a) "EXENAME p1 p2"

    or it can be

    b) "p1 p2"

    If you chose a), then the child process will have the following

    argv[0] --> EXENAME

    argv[1] --> p1

    argv[2] --> p2

    If you chose b), then the child process will have

    argv[0] --> p1

    argv[1] --> p2

    Either way, the process to be executed would be EXENAME (the 2nd param to CreateProcessAsUser). The called process however should be aware of the way command line arguments are going to be coming in.

    If you use b), you also have the option of passing 2nd param to CreateProcessAsUser as NULL.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am confused How to use looping for Json response Array in another Array.

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.