Open ci70 opened 3 years ago
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
-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
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
@7wgs0gr04v Maybe I found the way to meet your requirement. But I need to try to implement first.
How to elevate current process in script?