In Explorer sequence Shift+F10 -> open command window here
opens cmd in current directory.
Is there any way to do the same via shortcuts to launch cmd with administration rights?
To start a command prompt as an administrator (alternative method) Click the Start charm. Type cmd, right-click the Command Prompt tile, and then click Run as administrator.
Complete shortcuts are listed here Link to the answer
I added the commands to the Explorer context menu in the registry for the background, folders, and files.
I know that you wanted a keyboard shortcut. I am hoping that you can use and adapt the commands and use the existing Windows shortcut system that allows you to set keyboard shortcuts.
Here is a link to an article that has the commands and a link to a ZIP with a REG file:
https://dkcool.tailnet.net/2019/05/add-open-admin-command-prompt-to-the-explorer-context-menu-in-windows-10/#tldr/
Adding to the Windows registry:
For the folder context-menu: (right-clicking on a folder in an explorer window)
powershell -WindowStyle Hidden "start cmd \"/k cd /d %1\" -v runAs"
For the background context-menu: (right-clicking on the background of an explorer window):
powershell -WindowStyle Hidden "start cmd \"/k cd /d %V\" -v runAs"
For the file context-menu: (right-clicking on a file in an Explorer window):
powershell -WindowStyle Hidden "start cmd \"/k cd /d %w\" -v runAs"
Here is a link to an article about the shell variables:
https://superuser.com/questions/136838/which-special-variables-are-available-when-writing-a-shell-command-for-a-context
EDIT:
I added keyboard shortcuts using Shift+F10, Shift+Context menu key, or Shift-Right click, and then a given letter for the desired option, which you can modify in the registry. I put all of the files onto GitHub at the link below.
https://github.com/DKCTC/windows-terminal-admin-shortcuts-registry
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With