53

Is it possible to open the command prompt with Windows 7 with a shortcut key, and if it is, how do you do it?

I know that I can assign a shortcut key to it, but does Windows come with a shortcut key already?

I know in that in Ubuntu, with the Unity desktop environment at least, you can press Ctrl + Alt + T.

Eric Wilson
  • 7,868
  • 12
  • 41
  • 50
Dozer789
  • 633
  • 1
  • 6
  • 7
  • 2
    In Linux there may be no such shortcut key, depending on desktop environment. In fact, there rarely is one (except Alt+F2, entering something like `xterm` or another terminal emulator and pressing Enter, but this is analogous to Windows' WinLogo+R, `cmd`, Enter). – Ruslan Mar 14 '14 at 12:37
  • @Ruslan I should have said the flavour... I am using Debian 12.04 LTS – Dozer789 Mar 14 '14 at 22:59
  • You must mean Ubuntu 12.04 LTS. There's no such thing as Debian LTS, nor such versions as 12.04 for Debian. – Ruslan Mar 15 '14 at 04:07
  • @Ruslan Sorry, I don't why I said Debian... I meant Ubuntu. – Dozer789 Mar 17 '14 at 23:13
  • `Shift + F10` for windows 7 installation interface. So you can run command like `diskpart` before installation process. – Nick Dong Feb 06 '18 at 12:43

17 Answers17

84

For normal prompt, follow these steps:

  • WinKey+R
  • Input "cmd".
  • Enter

.
For elevated (administrator) prompt, follow these steps:

  • WinKey (Start Menu opens on the left-bottom corner)
  • Input "cmd".
  • Ctrl+Shift+Enter
    .

You can, of course, create a special shorcut for your computer, but memorizing the above keys should be useful because they work on every vanilla (untouched) Windows version (NT, XP, Vista, 7, 8, 8.1... even Win98 or 95, if you still use them), and, as far as I know, flavour (Home, Pro, Server, Premium, Ultimate... etc).

EDIT May 2016: Checked working on Windows 10.

Sopalajo de Arrierez
  • 6,603
  • 11
  • 63
  • 97
  • 4
    +1 This is the best method IMO. Simple, allows for elevated, and works on stock installations. – Ron Mar 14 '14 at 10:04
  • 3
    It seems the ctrl+shift+enter trick doesn't work on Win8.1 though... But there you can select it directly from the menu-popup that's brought up by pressing win+x. – deroby Mar 14 '14 at 12:44
  • I have just tested it working fine on Windows 8. Don't know about v8.1 yet. – Sopalajo de Arrierez Mar 14 '14 at 13:10
  • @SopalajodeArrierez What is the difference between *normal prompt* and *elevated prompt*? – Geek Mar 15 '14 at 18:39
  • @Geek *elevated prompt* is running with administrative privileges. All launched programs will be elevated too. You'll have to confirm UAC dialog in order to start it. – gronostaj Mar 15 '14 at 19:11
  • @Geek, remember that **administrative elevation** of a program is a concept introduced on Windows Vista and existing since then. If your windows is older, you just don't need to worry about it. Maybe that fact has confused you. Anyway, I have edited the original post to add the word "administrator" for clarity purposes. – Sopalajo de Arrierez Mar 15 '14 at 19:36
  • @deroby: I have finally tested it working OK on Windows 8.1 in a HP Envy portable computer. I don't know why it didn't work for you. – Sopalajo de Arrierez Apr 30 '14 at 23:21
  • 3
    @SopalajodeArrierez turns out to be my own mistake off course. I re-read the issue and then realized that out of habit I pressed Winkey + R, then typed cmd and pressed shift-enter, thus starting it via the "Run"-box. This does not work indeed. Pressing just Winkey and typing cmd starts it via the "Search" and this one does indeed recognize the shift-enter. Sorry for the confusion! – deroby May 02 '14 at 16:56
  • There should be an option like "Developer Settings" where you can open a command prompt by a shortcut (and many other things, like create a file with a shortcut). I know that it would annoy the usual user if he accidencially opens CMD and has no idea what is happening (and give him the power to do dangerous things), but to no implements shortcuts at all for stuff like this is a major issue on Windows if you ask me. The method provided in this answer is not satisfying and it also doesn't work with the current directory you're in. – codepleb Jun 30 '16 at 08:36
  • 1
    With Windows 8, 8.1, and 10, you can now use the Admin menu. Press Win+X, A to start the Admin Command Prompt / Admin Power Shell – Canadian Luke Nov 17 '16 at 18:52
31

Easy as. You just need to create a shortcut to the command prompt somewhere to allow you to apply the hotkey combination to it. Here's one way to do it.

  • Hit the Windows button
  • In Search programs and files, type cmd
  • When cmd.exe is found, right-click on it and go Pin to start menu
  • Close and reopen the start menu (or just press Esc)
  • Right click on your new pinned shortcut and choose Properties
  • On the shortcut tab, you will find a field called Shortcut key
  • Select that field and set the key combination you want to use
  • Press OK

Job done!

Danny Beckett
  • 1,375
  • 6
  • 23
  • 38
Iain Fraser
  • 685
  • 6
  • 13
  • That is what I was talking about... I know I can set the hot key for it, I was just wondering if there was a pre-set one. – Dozer789 Mar 14 '14 at 00:39
  • 5
    No, there is no preset one. – Iain Fraser Mar 14 '14 at 00:40
  • This is the best way to do it. +1, but someone gave it a -1 – Devid Mar 14 '14 at 00:45
  • I am thinking that setting a shortcut for it is the best way for doing it. +1 from me! – Dozer789 Mar 14 '14 at 00:46
  • Why are people saying there is no preset one? Doesn't Win-R count? Maybe I'm misunderstanding the question... – loneboat Mar 14 '14 at 17:31
  • @loneboat: That opens a dialog where you can type a single commend, but is not a command prompt. still, I use `start+r,c,m,d,enter` very commonly – Mooing Duck Mar 14 '14 at 19:58
  • 1
    @MooingDuck: Haha, you're right. That's what I do as well (Win-R, cmd, enter). I do it so frequently that in my brain, I thought Win-R WAS a shortcut to Cmd. My mistake. :-) – loneboat Mar 14 '14 at 22:54
  • This spawns a new session each time. With normal applications, it's just re-opened/re-focused on when you hit the key-command. The solution in [this answer](http://superuser.com/a/728839/313690) opens the current session, based on its position in the taskbar. – aliteralmind Jan 13 '15 at 14:39
  • I noticed a couple of MSWindows7 oddities due to the given procedure: 1, although I pressed Win-], the keyboard shortcut entered as Ctrl-Alt-], which works to start cmd, although Win-] does not. 2, cmd started via shortcut begins in C:\Windows\System32 while cmd started via Win-R, cmd begins in C:\Users\JW – James Waldby - jwpat7 Apr 17 '16 at 18:40
25

Click Start, and type cmd. Right click the icon, and click Pin to Taskbar. Then, depending on its position, you can press Win + 1-9, depending on its position from the Start orb.

Danny Beckett
  • 1,375
  • 6
  • 23
  • 38
Canadian Luke
  • 24,199
  • 39
  • 117
  • 171
  • This is what I would do. I like that feature. It was even added to Ubuntu. – OregonTrail Mar 14 '14 at 04:56
  • Perfect!!! It reopens/re-focuses on the *current* command prompt session, instead of spawning a new one, as in [this answer](http://superuser.com/a/728819/313690). – aliteralmind Jan 13 '15 at 14:41
13

Use AutoHotKey for this.

Example(CTRL + Alt + T):

^!t::
Run %comspec% /k
return

Note: comspec is a built-in variable that resolves to C:\Windows\system32\cmd.exe on a typical system.

stderr
  • 10,264
  • 2
  • 32
  • 49
11

In Windows 7 there's also a convenient way to create a command line window pointing to a folder that is currently open in explorer: Shift + Right-click in that folder and select "Open command window here":
convenient way to create a command line window pointing to a folder
See this sevenforums post for more examples of Shift changing default behavior.

bizzz
  • 253
  • 3
  • 11
  • 7
    Even better, in the address bar type `cmd` – TankorSmash Mar 14 '14 at 15:09
  • Shift+Right click offers this option on desktop as well. – David Starkey Mar 14 '14 at 17:14
  • Also works in Windows 8 / 8.1 – user11153 Apr 08 '14 at 10:50
  • Not only `cmd`: you can use the _explorer_ address bar as a command line input. So you can open _any file_ (with a opening way defined) in _any folder_ in `%PATH%`, not only _.exe_ but also *.bat*, _.ps1_ or even _.txt_, etc. The selected folder will be the working directory and also any file arg will be looked for there. Just like in _cmd_. Not much people uses this or even know it. Two cons; if the file is not found, the explorer address bar will try to search the text in your default browser; _and_ if you run a console program you usually can't see the result because the window closes. – cdlvcdlv Jan 07 '18 at 17:29
10

The best way !(no typing and no clicking just shortcut key)

  1. Make a shortcut of this cmd.exe file at desktop
  2. Go to the shortcut's properties and there will be a space for shortcut-key ... input any key of your choice (lets say c) then the shortcut key turns to ctrl + alt + c.
  3. Now test it out anywhere!

Another way out (this has 2 key combo)

  1. drag cmd.exe to just beside the windows orb at bottom-left corner of your screen (by default the orb is there)
  2. press winkey + 1(yeah! the key with windows logo and the number 1)

UPDATE (15-apr-2020 on up to date windows 10): it still works

P.S : and the best part of this is that you can have programs which can open with shortcut keys of your choice!

Mukul Kumar
  • 714
  • 7
  • 17
7

Win8+ method:

Win+X, C: CMD

Win+X, A: CMD as admin

FYI: I am aware the question requested a solution on Win7, but I thought this solution was too good NOT to share! :)

gregg
  • 5,598
  • 2
  • 21
  • 36
  • 1
    Works in Win10! – Marslo Aug 24 '17 at 10:20
  • Doesn't in W10 - Italian (Win+i run powershell, Win+a run admin powershell) – DDS Oct 22 '19 at 16:00
  • @DDS Yes Win10 v1809 (build 17763) or earlier Microsoft replaced PowerShell instead of Command-Prompt. Switch back: right-click Taskbar, Taskbar settings, toggle this entry OFF: 'Replace Command Prompt with Windows PowerShell in the menu when I right-click the start button or press Windows key+X.' – gregg Oct 23 '19 at 21:00
  • The issue isn't powershell, the issue is that in Italian "C" and "A" arn't the underlined letter, so the press win+x then C/A does not work because the involved letters are different. Anyway thanks for suggestion on how to restore CMD as default command prompt. – DDS Oct 24 '19 at 13:15
2

In Windows, any link (.lnk) can have a hotkey assigned. Create a link to cmd.exe, go to its properties and set the hotkey.

Or you can pin any program to a task panel and start it with Win+(digit) combination. Win+1 will start the first icon on the task panel, Win+2 - the second one and so on.

techraf
  • 4,852
  • 11
  • 24
  • 40
1

You can use AutoHotkey to make a keyboard shortcut for the command prompt and set it to any key combination you want. It's easy to set up and use.

Peter Mortensen
  • 12,090
  • 23
  • 70
  • 90
Keltari
  • 71,875
  • 26
  • 179
  • 229
0

As an alternative to typing "cmd" in an explorer window: If you always want to open a command prompt in a specific folder, then you can use a simple .bat file on your desktop: "@echo off echo Any text F: CMD /K CD F:" The "F:" is required if the disc is not "C:"

Phil
  • 1
  • 1
0

Windows does not come with a shortcut key to the command prompt. The closest thing would be the extended context menu (Shift + Right-click) on the Desktop or perhaps just Win + R and then running cmd.

Danny Beckett
  • 1,375
  • 6
  • 23
  • 38
Matt
  • 235
  • 2
  • 4
  • 14
  • How do I add one of those to the cmd? – Dozer789 Mar 14 '14 at 00:33
  • On Windows 7, Shift + Right-click on the Desktop should give you an option that says "Open command window here." If you'd like a right-click option to be available anywhere, I've found [Ultimate Windows Context Menu Customizer](http://www.door2windows.com/ultimate-windows-context-menu-customizer-customize-context-menu-in-windows-xp-vista-7/) to be helpful. – Matt Mar 14 '14 at 00:35
  • That Ultimate Windows Context Menu Customizer looks useful. I'll look into that. – Dozer789 Mar 14 '14 at 00:41
0

If you are a keyboard guy, you will like Launchy.

Launchy indexes the entries in the start menu (configurable, other places are possible too). Now, you hit Alt+SPACE and the Launchy window opens.

Type cmd and the console opens.

IMO a much more natural way to start applications (by their name) than Autohotkey.

eckes
  • 508
  • 5
  • 8
  • 19
  • 1
    It's quite unnatural to install a special tool to run an executable in `%PATH%`. WinLogo+R can do this, and it's available by default. – Ruslan Mar 14 '14 at 12:40
  • 1
    Yep. Things get interesting when you want to start something not in `%PATH%`. Or if you not only want to start an executable but for example open a word document, calculate something quickly etc. Launchy handles all that. Give it a try. Once you've used it you'll never want to miss it again -- if you're a keyboard guy. If you're fine with clicking through the explorer, Launchy is not for you. – eckes Mar 14 '14 at 12:44
  • 1
    It's overkill for the OP's question. As for myself, I don't use Windows, I'm happy with Yakuake @ Linux :) – Ruslan Mar 14 '14 at 12:48
  • @Ruslan: yep. Solves more that OPs problem. Give a man a fish... you know? – eckes Mar 14 '14 at 12:50
0

Not quite a shortcut key, but still only a mouse-click and 4 keystrokes away: Since Vista, in File Explorer editing the "breadcrumbs" address and overwriting it with cmd and pressing Enter will start cmd.exe and a bonus: it starts it in the folder you're currently displaying.

Mark Hurd
  • 409
  • 1
  • 6
  • 15
0

Simply type cmd into the address bar of an explorer window. It will open a command window in the current location.

felwithe
  • 764
  • 3
  • 11
  • 26
-1

I have a collection of productivity tools. You can find how do I open cmd window at Open Command Window:

If Win+c is pressed in windows explorer, the opened command line window will use the same path in the windows explorer as the current directory

If you don't want to get the whole rwin package. The closest is to put the cursor in windows explorer and type in "cmd" to get the command window in the current directory.

Codism
  • 933
  • 12
  • 18
-2

Depending on what you are looking for, the simplest method is hit Ctrl-M with the explorer window open. A power shell command prompt opens on the directory where you are working at.

Stephen Rauch
  • 3,091
  • 10
  • 23
  • 26
-2

It is better to:

  • Create a custom shortcut of CMD.EXE on the desktop
  • Go to properties of shortcut you have created
  • Assign a custom key to whatever you want in the shortcut key textbox
  • Press the shortcut key on the keyboard, and it starts opening
Peter Mortensen
  • 12,090
  • 23
  • 70
  • 90
Vikash
  • 1