Currently (In Windows 10) - if I want to open a CMD prompt, I'll hit the Windows key, type
CMD and hit Enter. If I want it open as an administrator, I have to
right click the item and click
Run As administrator. Is there a way I can do this without using the mouse?
Ctrl+Shift+Enter is convenient, but if you prefer Linux-like environment, you can save this script as
sudo.cmd somewhere in your
@echo Set objShell = CreateObject("Shell.Application") > %temp%\sudo.tmp.vbs @echo args = Right("%*", (Len("%*") - Len("%1"))) >> %temp%\sudo.tmp.vbs @echo objShell.ShellExecute "%1", args, "", "runas" >> %temp%\sudo.tmp.vbs @cscript %temp%\sudo.tmp.vbs
Then you can use this command:
If you find yourself opening administrative command prompts all the time, you can create a shortcut on the taskbar:
- Find Command Prompt in the search results. (Searching for
- Right-click it and choose Pin to taskbar.
- Open the taskbar shortcut's properties by right-clicking the icon, then right-clicking the Command Prompt entry that appears and choosing Properties.
- On the Shortcut tab, click the Advanced button.
- Check Run as administrator and OK out of the properties window.
You can now activate that shortcut by holding the Windows key and pressing the number that represents the position of that icon (not including the standard Windows 10 desktop switcher icon). For example, if your command prompt icon is the second pinned item, pressing Windows+2 would activate it. Pressing Alt+Y accepts the UAC prompt. That's just two keyboard commands, for a total of four keys, no mouse.
If your keyboard has the menu key, you can use that instead of right click.
This is not as convenient as some of the other options in this case, but it's also more general.
I'm assuming that "fast" in the original question refers to speed of use, and the time investment to set this up is not a concern.
If this is true, The following will certainly lead to a fast startup since it elevates without needing to deal with the UAC prompt.
To provide a synopsis of the technique, you create a task in task scheduler that runs your program of choice with elevated credentials. Starting this program does not require interaction with a UAC prompt, and by invoking task scheduler with suitable parameters, you can launch your program of choice with a double click on a shortcut.
This does require a separate task scheduler task for each different program you want to run elevated.