-
-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RunAs functionality #174
Comments
Hey there. Unfortunately, running as admin is only possible via shell execute. This means that we won't be able to gain access to the process's output streams or do other things like kill the process on cancellation. This is a security limitation that prevents non-elevated processes from accessing information from elevated processes. In that state, 90% of CliWrap's functionality becomes effectively useless. Because of this, your best bet is to offer a prompt for the user to relaunch your own application with admin privileges, and then use CliWrap as you would normally to run other processes after that. |
Oleksii,
Thanks for your rapid response! The fact that I was unable to find the
strings, "verb", "runas", and admin in your source code, I figured as much.
Oh well. I can simply code a x = new ProcessStartInfo with the appropriate
arguments and do it the old fashioned way!! 😇
Thanks again!
Steve
…On Thu, Nov 10, 2022 at 4:07 PM Oleksii Holub ***@***.***> wrote:
Hey there.
Unfortunately, running as admin is only possible via shell execute. This
means that we won't be able to gain access to the process's output streams
or be able to do other things like kill the process on cancellation. This
is a security limitation that prevents non-elevated processes from
accessing information from elevated processes. Because of this, your best
bet is to offer a prompt for the user to relaunch your own application with
admin privileges, and then use CliWrap as you would normally to run other
processes after that.
—
Reply to this email directly, view it on GitHub
<#174 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOPRYYJJ4KVFLWSHFROMNQTWHWE47ANCNFSM6AAAAAAR5CX32M>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Cheers! |
Details
Greetings,
First off, I love CliWrap! I have used it now in several of my projects. Thanks for your efforts! You've really done a great job with this project!
I have a need to run some PowerShell scripts that need to be run with admin privilege. I do not see anywhere in your APIs where I can specify the Verb parameter on the process object. Am I missing it or do I need to request this feature? If it is there, I'd love to know how to run a process as administrator.
Also, I check the progress that Ukraine is making against the Russian aggressors. I read with joy whenever I see that Russia is in retreat, having their helicopters and aircraft knocked from the skies, and seeing the Russian cowards getting their asses kicked! All of Ukraine is in my thoughts and prayers, my friend!
Cheers,
Steve Miller
The text was updated successfully, but these errors were encountered: