82
By holding CTRL + SHIFT whilst pressing Enter, it opens as an administrator.
Seems you can also hold CTRL + SHIFT + Left Click a CMD window on the taskbar (probably other applications too) to open a new one as an administrator also.
Confirmed working in Windows 7, 8, 8.1 and 10.
Yes, it definitely works in 8/8.1. I believe it worked in 7, too, but I can’t try it right now. – Daniel B – 2016-01-21T06:31:55.340
I confirm this works in Windows 7 and 8 too, both on Taskbar and in Start menu, and it works for every application (except for Modern UI app aka Windows Store apps or Metro apps). – Alexey Ivanov – 2016-01-21T08:55:14.627
Exactly that is the reason why there is the option to post an answer right along with the question: to leave things here that are useful to future users, there is even some faq or so about it, so no need for the introductionary disclaimer. – PlasmaHH – 2016-01-21T11:01:38.103
@PlasmaHH I realise that, but as I found an answer minutes apart I wanted to be sure people didn't think I was simply talking to myself :) – Jonno – 2016-01-21T11:03:22.977
You can also use WinKey+X tools menu or File\CommandPrompt in Explorer (useful when keyboard is missing) on 8.1/10 - screenshots and stuff (can anyone check on Win7?)
– PTwr – 2016-01-21T13:45:42.627Shortcut CTRL+SHIFT+ENTER Does NOT work in Windows 10 64 bit (ENT.) – integratorIT – 2016-01-21T14:33:58.217
2But it does. I use it daily. – Daniel B – 2016-01-21T16:51:19.723
1NIce! +1 Also if you have something you always want to launch as an admin, you can right-click, go to properties, click Advanced, and then check the "run as administrator" box. It will prompt for elevation every time you launch it. Not all shortcuts/links/programs allow that, though. For example, my MIcrosoft Edge shortcut won't let me right click and go to properties. I see Ben N has put this as an answer. – Todd Wilcox – 2016-01-21T17:50:57.543
3Note that this ONLY works on the Start menu bar. It does NOT work with Win+R's run prompt. – Nelson – 2016-01-22T05:35:48.177
@Jonno Don't forget that you can accept your own answers to a question you make! – AndrejaKo – 2016-01-23T10:40:15.253
1Great way to shave a few hundred milliseconds off your workflow. Changed my life. +1 – PNDA – 2016-01-23T16:20:55.200
Where the hell is that documented? Also, thanks! – JCM – 2016-08-12T23:34:00.980
22
For Windows 8.1 and 10 English, to open an Adminstrator command prompt using the keyboard use
Windows Key + X followed by A
For other languages, the appropriate key to use will be indicated by an underline in the pop-out menu.
3Have in mind that menu shortcut mnemonics tend to be localized, so it might be different for some languages. (Although admin is rather stable in that matter) – PTwr – 2016-01-21T13:56:10.213
2In my language, it's Windows
+X
, then C
. – Petr Hudeček – 2016-01-22T08:06:24.417
This should be the accepted answer. It's the fastest method out of all the answers here. – PNDA – 2016-01-23T16:22:56.620
1@PandaLion98 It doesn't answer the question. OP asked for a solution for any program, not just Command Prompt. – David Marshall – 2016-01-23T17:11:41.503
@DavidMarshall Touche – PNDA – 2016-01-24T00:50:54.793
8
Ctrl+Shift+Enter is convenient, but if you prefer Linux-like environment, you can save this script as sudo.cmd
somewhere in your PATH
:
@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:
sudo cmd
1
Apparently, you, yourself already have given attribution before :P : http://superuser.com/a/640599
– d0nut – 2016-01-22T17:06:56.7871@iismathwizard That's... interesting ;) Thanks! – gronostaj – 2016-01-22T20:47:19.097
4
If you find yourself opening administrative command prompts all the time, you can create a shortcut on the taskbar:
cmd
works.)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.
1+1 Note that if the account you're using is not a local administrator (which it really shouldn't be!) you can't just Alt+Y, you actually have to put in a username and password of an administrative account. This method is perfect for launching any kind of admin tool, like Server Manager or Powershell where you want to have it run as a domain admin but don't want to log on to your computer as a domain admin. – Todd Wilcox – 2016-01-21T17:53:58.103
1Note that the Windows
+2
trick (which I'd not seen before) acts essentially the same as clicking on the icon involved: it will launch the shortcut if it's not running, or switch to (or cycle between) it/them if it's already running. (This was on Windows 7). – TripeHound – 2016-01-22T16:55:31.337
2
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.
3If your keyboard doesn't have a menu key, you can use shift-f10 instead. – Gerald Schneider – 2016-01-22T10:52:09.467
1
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.
http://www.thewindowsclub.com/create-elevated-shortcut-run-programs-bypass-uac
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.
0
win+r, regedit.exe, ctrl+f "enablelua", wait a bit, set the d-word value to 0
Everything will now open with admin privileges by default.
2on win10 and win8, you can right click start button and choose "command prompt (admin)". I think this is the fastest way. since i don't like to work with a mouse, i use CTRL SHIFT ENTER, just as suggested in the answers – SimonS – 2016-01-21T14:40:47.017