0

I have an app that reads/writes few files from C: and needs elevation.

I also have to run an application that has to run without admin rights (in order to read an mapped network drive).

I've tried to impersonate the user, but it will ask the user's password again (which isn't a big problem, but would be better if does not). If I run this application with admin rights it can't see the mapped drive (created from user, not admin).

How is it possible to run this application without admin rights from this elevated app?

Thanks in advance,

BR

3
  • You can run one of your apps as a subprocess of another using Process class. But I do generally think that it's a bad Idea and that you should sort users and accesses out with your admin. Dec 7, 2021 at 16:52
  • 1
    Does this answer your question? Start non-elevated process from elevated process
    – gunr2171
    Dec 7, 2021 at 17:00
  • Yes! Thanks very much! It works by using the explorer process, normally not elevated, to open files.
    – G. Manucci
    Dec 7, 2021 at 17:28

1 Answer 1

-3

This Code Should Work It For C++

#include <string>
#include <iostream>
using namespace std;
char Command[32]; // Sending Output To Line 10
void CMD()
{
    cout << "icr0$0f Wnd0ws[Version 10.0.22000.856]\n(c) icr0$0f C0rporati0n.All rights reserved.\n"; // I Think This Line Is Illegal
    cout << "\nC:/User/s132759>"; // Your User Name
    cin >> Command; // Sending Output To Line Four
    system(Command); // Puts The Input In A Command
}
int main()
{
    system("title Command Prompt"); // Make The Title Command Prompt
    CMD();
}
1
  • But the question is tagged for C#. This doesn’t answer the question. Aug 31, 2022 at 0:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.