Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

Elevate current process? #52

Open
ci70 opened this issue Jan 10, 2021 · 4 comments
Open

Elevate current process? #52

ci70 opened this issue Jan 10, 2021 · 4 comments

Comments

@ci70
Copy link

ci70 commented Jan 10, 2021

How to elevate current process in script?

@MouriNaruto
Copy link
Contributor

MouriNaruto commented Jan 11, 2021

If you wonder to run the app as the token from the current NSudo process.

Refer to https://m2team.github.io/NSudo/en-us/docs/#command-line

You can use -U:P parameter.

But if you need to elevate current process directly. NSudo and Priviexec aren't able to do it. (Because these tools don't need to load the driver. You can't replace the process access token unless you using a driver.)

Kenji Mouri

@ci70
Copy link
Author

ci70 commented Jan 11, 2021

-u:p will create process only.

Example how to do it.
https://github.com/modzero/fix-windows-privacy/blob/master/fix-privacy-base/SelfElevate.cpp

@MouriNaruto
Copy link
Contributor

MouriNaruto commented Jan 11, 2021

OK, I understand what your mean.

Command line version of NSudo (NSudoC) don't elevate automatically because we take care about the command line experience. (Pop up the UAC window will break the immersive command line experience.)

In my opinion, you should elevate your script first. (If you don't do that and NSudoC supports the elevate automatically, the user of the script may suffer from multiple UAC pop up windows if you use NSudoC multiple times in your script.)

Kenji Mouri

@MouriNaruto
Copy link
Contributor

@7wgs0gr04v Maybe I found the way to meet your requirement. But I need to try to implement first.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants