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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:24:27+00:00 2026-06-14T06:24:27+00:00

I need to run Chrome as admin from plugin dll code(VC++). But if a

  • 0

I need to run Chrome as admin from plugin dll code(VC++).
But if a chrome window is active ,newly created window didn’t get admin privileges.
I’m calling plugin dll code from JavaScript. After creating new window I closed previous window,but same happens.
I want help, because my plugin needs admin privileges.same in case of Firefox.
(now I’m using shellExecute for creating a new window as admin).

code snippet:

Here I create an instance of Firefox( need similar for all browsers)

StartNewInstance(BSTR Address)  
{  
    // TODO: Add your implementation code here  
    MessageBox(0,L"Inside",L"ParentName",0);  
    TCHAR szEXEPath[2048];  
    GetModuleFileName ( NULL, szEXEPath, 2048 );  
    SHELLEXECUTEINFO Shex;  
    ZeroMemory( &Shex, sizeof( SHELLEXECUTEINFO ) );  
    Shex.cbSize = sizeof( SHELLEXECUTEINFO );  
    Shex.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOCLOSEPROCESS;  
    Shex.lpVerb = L"runas";  
    Shex.lpFile = L"C:\\Program Files\\Mozilla Firefox\\firefox.exe";  
    Shex.nShow = SW_SHOWNORMAL;  
    Shex.lpParameters = Address;  
    ShellExecuteEx( &Shex );  
    return true;  
}
  • 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-14T06:24:28+00:00Added an answer on June 14, 2026 at 6:24 am

    You cannot solve this easily in the way you are trying to. Most browser executables will check for an existing instance and reuse that one if found. There are browser-specific ways to tweak or skip that check via command-line options in order to allow you to spawn a second process, but they are browser-specific, and even some of those browsers are more stuck up than others.

    For example, invoking chrome.exe (as administrator) with --user-data-dir=c:\some\path will create a new (elevated) instance the first time it is called, and reuse it on subsequent times provided you give that same user data dir on the command line (even if another (non-elevated) chrome is running all this time with defaults.) The path in question can be anything provided that it exists (you can create it as an empty directory if it doesn’t), and it should be yours, not shared with other applications. It can be temporary.

    Similarly, invoking firefox.exe (as administrator) with -no-remote -profile c:\some\path will create a new (elevated) instance when called even when an instance with a standard profile is already running, though subsequent invocations must use a different profile path or else Firefox (unlike Chrome) will interactively complain that you are essentially trying to run more than one instances from the same profile directory.

    You can see from the above that it is possible, but troublesome and error-prone to spawn a new browser window with elevation, which begs the question: what exactly do you need to execute with elevation in that new browser? Does the entire browser really need to run with elevation, or can you delegate “need elevation” functionality to a helper process (that you can easily spawn “as admin” and talk to via the loopback or via named pipe, irrespective of what your host browser is?)

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

Sidebar

Related Questions

I need to run an external application from within my Java code. I can
The following code works only in Chrome. I need it to run on all
This javascript code run without problem in chrome and IE but have a problem
i need run code that will create a database and populate tables. i am
I need run ts:reindex when smth add in model or destroy from model. How
I need to Run javascript in adress bar.where the js code is contained in
I'm working on a chrome extension and I need to get the event when
I really need to run Chrome in kiosk mode with an extension. If I
I'm submitting a form but need my form to run some checks first so
I need to build a chrome extension where I can run the python program?

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.