Enable Keyboard Shortcut Ctrl+V to Paste in Windows Command Prompt

6

If you have used command prompt (Start > cmd) in Windows, you will know that any keyboard shortcut (ex. copy is Ctrl+C) that you normally use in other application is prohibit in Windows command prompt. Hence you can’t copy and paste any text inside command prompt. I don’t know why Microsoft choose not to enable this function. Lately this limitation becomes increasingly irritating, when I’m working on a application with Ruby on Rails that requires a lot command line actions.

So I found a solution that let’s you enable keyboard shortcut Ctrl + V to paste inside Windows Command Prompt.

Credit goes to How-to-geek, what you need to do is first download this nifty utility called AutoHotkey then you need to copy and paste the following script into the program.

#IfWinActive ahk_class ConsoleWindowClass
^V::
SendInput {Raw}%clipboard%
return
#IfWinActive

enable past in cmd

If you aren’t sure what to do with the above code you can download this script and run the script, assume you have AutoHotkey already installed on your machine.

copy and past in cmd

So now while have this utility running you can copy any text and use the keyboard shortcut to paste it inside your Command Prompt.

Enjoy !

Download AutoHotkey here, download enable Paste in Command Prompt Script here.

6 COMMENTS

  1. Or you could simply right click & paste. Another thought would be to throw away the CMD for PowerShell. In a POSH screen, you simply right click and it’ll paste for you. This may have been a good tip like 10 years ago, but it’s just not relevant. /facepalm

  2. If you work on Windows and linux, edit the script and change “^V::” to “+^V::”. This changes the shortcut to ctrl-shift-v, and thus the same keystroke does the same thing on both CMD and linux Terminal.

  3. You can also paste using a keyboard shortcut without using this script.

    Just hit Alt + Space, E, then P.

    It takes just about the same time as Ctrl + V if you get good at it. I’ve been using this shortcut for years.

LEAVE A REPLY

Please enter your comment!
Please enter your name here