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

  • Home
  • SEARCH
  • 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 8940497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:02:52+00:00 2026-06-15T11:02:52+00:00

I have a command that i need run by cmd.exe when something happens in

  • 0

I have a command that i need run by cmd.exe when something happens in my program. Let’s say the command is “calc.exe”. When i use ShellExecute:

HWND win = GetActiveWindow();
ShellExecute(win,L"open",L"calc.exe",L"",L"", SW_SHOWNORMAL );

The calc.exe process starts in session 0 so i cannot see it. Is there any way to set it to start in the active users window? I don’t want to use CreateProcess as I have been having privilege issues with it

Thanks

  • 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-15T11:02:53+00:00Added an answer on June 15, 2026 at 11:02 am

    No. ShellExecute cannot run a program in another session. You’ll need to use CreateProcessAsUser. There are numerous questions on here that discuss how to do this.

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

Sidebar

Related Questions

I have this command that i need to run cd /d C:\leads\ssh & C:\Windows\System32\cmd.exe
I have an application that need to send command to cmd and then get
I have the following SQL command that I need to save as a csv
I have a command that I want to run on machine B from machine
I have a command line program that prints out a report such as: I
I wanted to run a .cmd file from Java. I have something which works
I have a C# program that needs to spawn a .BAT command file during
I need to run a command on the command-line that asks for a user
I have a Windows program that has a GUI which also uses a command
I have a requirement that I need to run the tests through commandline as

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.