Link to home
Create AccountLog in
Avatar of Steve_Brady
Steve_BradyFlag for United States of America

asked on

Paste commands into a DOS prompt rather than typing them


This question exposes the laziness [:P] (or perhaps we can call it the desire for greater efficiency) in modern computing but:

Is there a way to paste commands into a DOS prompt rather than typing them?


Avatar of Steven Carnahan
Steven Carnahan
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
What's the problem?  I always do this without having any problems so far.
If you prefer to do it with keyboard:
Alt plus Spacebar will open the same context menu as right-click on title bar does.
Then look which letters are underlined, they can be typed (e for edit, p for paste).
That's how I always do it.

reminds me of the old days when using to write programs in basic.  Windows 3.0 and 3.1 we used the Alt key to bring up the top menu all the time.  We didn't need to use the spacebar though.  :)
Avatar of phoenix5ire

Depending on your OS, there are several ways of doing it but sometimes, a little visual is quicker to explain so I'll be lazy here as well:
Copy / Paste via Command prompt
Just like any copy and paste using mouse works. Am I missing something?
Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
I noticed that as well after some of the other comments.  

Now if they would only come up with a way to permit the keyboard shortcuts Ctrl+c and Ctrl+v for copy/paste even I might be happy.  Probably not though.  :(
The setting responsible to allow to "click in the black" to get the menu is called Quick Edit Mode. It is located in the cmd.exe window's properties, Options tab, and is also responsible for marking text if you left-click into the cmd window (to actually copy the selection to the clipboard, press Return).
Or to state the obvious, use a batch file -- You could also just put them into notepad and save-as type="all files" and save as whatever.cmd or whatever.bat and run that from cmd.exe prompt, or from shortcut etc.

I use the right click / paste all the time though :-)
When you say 'command prompt' do you mean cmd.exe or

'CTRL-V' definitely pastes the clipboard's contents into a CMD box.
Paul, you are wrong. Ctrl-V pastes a ^V charachter (which is the ctrl-v character representation).
Agreed there Qlemo unless there is some setting I'm not aware of... would be useful sometimes if there was!
A right mouse click is the first step in pasting into a command prompt window.

If you do not have a mouse, then you can use the following keystroke sequence:

Open in new window

If you don't mind a third party app to be able to use CTRL+V you can always look at AutoHotKey:  And a script for this function can be found:

It's been a long time since we've communicated to each other. You know I have a lot of respect for you. We did some pretty cool batch stuff way back.

Paul, you are wrong. Ctrl-V pastes a ^V charachter
I stand to be corrected. You are right. Funnily enough, I do so much stuff in DOS, editing inside a DOS box has become so automatic I don't notice I am pulling up a menu to paste. I've forgotten how much this used to bug me in the early days. Lol.
You can turn on 'QuickEdit Mode' for a DOS box.

To paste from another application into the DOS: click the right mouse button.

To copy a 'word' from DOS: double-click a word with the left mouse button.

To copy a phrase from DOS:  click the left mouse button while dragging the mouse over the phrase, then click the right mouse button.

Copying from another application is straightforward (e.g., CTRL-C) and use the paste method as described above.

Pasting into another application is straightforward...

NOTE: When pasting into a DOS box, if you inadvertantly click the right mouse button (which puts you in Edit Mode) press the ESC key or any of the following: arrow keys, backspace key, DEL key, RETURN key, etc. to return to non-edit mode.
Don't you think my additional explanation in http:a39181794 is worth to get included? It is less about the points (50 or so would be ok), more about having that post prominent, as Quick Edit Mode is something many folks do not know about (the default and what it effects).

Actually, I think there were several answers that deserve the recognition. I was not aware of the Quick Edit Mode myself. I have just been doing it the way I described initially for a long time.
Avatar of Steve_Brady


Thanks for all the responses and comments.