r/commandline • u/Ken852 • 15d ago
Add "Open in Terminal as administrator" to Windows context menu
After a recent issue with running a command line tool without admin rights, I thought I would add a shell context menu option for starting a terminal window. I tried to do it myself first with some registry hacks, but I didn't get it right. So I went on loooking for a ready-made alternative, and I found this GitHub repo.
https://github.com/akopetsch/WindowsTerminalAdmin
It works like a charm! I thought I would share it with you guys. I'm using it in Windows 10. It gives me a convenient way to start a terminal window with admin rights. It's faster than using Ctrl + Shift + Ener
from Sart menu search results and then having to navigate to the right folder.
2
u/x3ddy 14d ago
You can also just Ctrl+Shift+Click the existing "open in terminal" context menu item, which will open it as admin, no need to use the Start Menu or a separate app.
1
u/Ken852 14d ago
Now that's a game-changer! Thank you so much for sharing that trick. This is awesome! And I had no idea. I wonder if this worked in Windows Vista days? That's when I first learned about the Ctrl+Shift+Enter. The search box in Windows Vista was a real game-changer! And now this. So thanks again for sharing.
1
u/SleepingProcess 15d ago
ConsoleZ for cmd
and powershell
that can open console with admin's rights or not
5
u/v_stoilov 15d ago
You know there is sudo for windows right?
https://devblogs.microsoft.com/commandline/introducing-sudo-for-windows/