

It's not possible to grant additional permissions to an already running process. (A new cmd.exe.) In the case of the Command Prompt, starting a new instance with an access token that has higher permissions will always result in a new window being created. I put all of the files onto GitHub at the link below.TL DR - The only option is to spawn another process. 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. Here is a link to an article about the shell variables: Powershell -WindowStyle Hidden "start cmd \"/k cd /d %w\" -v runAs" Powershell -WindowStyle Hidden "start cmd \"/k cd /d %V\" -v runAs"įor the file context-menu: (right-clicking on a file in an Explorer Powershell -WindowStyle Hidden "start cmd \"/k cd /d %1\" -v runAs"įor the background context-menu: (right-clicking on the background of Here is a link to an article that has the commands and a link to a ZIP with a REG file:įor the folder context-menu: (right-clicking on a folder in an explorer window) 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. I know that you wanted a keyboard shortcut. I added the commands to the Explorer context menu in the registry for the background, folders, and files. To open an administrative Command Prompt window in the current folder, use this hidden Windows 10 feature: Navigate to the folder you want to use, then hold Alt and type F, S, A (that keyboard shortcut is the same as switching to the File tab on the ribbon, then choose Open command prompt as administrator).That opens a non-admin Command Prompt session in the selected location. In a File Explorer window, hold down Shift as you right-click on a folder or drive.That opens a non-admin Command Prompt session in the current folder. From File Explorer, click in the address bar to select its contents then type cmd and press Enter.To open the session as an administrator, press Alt+Shift+Enter. Type cmd in the search box, then press Enter to open the highlighted Command Prompt shortcut.You can also use keyboard shortcuts for this route: Windows key + X, followed by C (non-admin) or A (admin). Right-click Start & choose Command Prompt or Command Prompt (Admin) from the Quick Link menu.
