Skip to content

Instantly share code, notes, and snippets.

@msoxzw
Last active September 14, 2020 14:57
Show Gist options
  • Save msoxzw/604aef09e82397e31f023b6ea605f619 to your computer and use it in GitHub Desktop.
Save msoxzw/604aef09e82397e31f023b6ea605f619 to your computer and use it in GitHub Desktop.
One command line run as self-elevated administrator
@whoami /groups | find "S-1-16-8192" && (echo Start-Process cmd '/c ""%~f0" %*"' -Verb RunAs | PowerShell - & exit /b)
@msoxzw
Copy link
Author

msoxzw commented Oct 16, 2019

Support command line argument as well, which is unavailable in the system "run as administrator"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment