Solved

Paste commands into a DOS prompt rather than typing them

Posted on 2013-05-17
21
320 Views
Last Modified: 2013-06-04
Hello,

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?

Thanks

:)
0
Comment
Question by:Steve_Brady
  • 5
  • 3
  • 3
  • +6
21 Comments
 
LVL 26

Assisted Solution

by:pony10us
pony10us earned 500 total points
ID: 39176112
When in the command prompt window, if you have already copied the command to the clipboard, you can right click on the top (title) bar and go to edit/paste
0
 
LVL 24

Expert Comment

by:aadih
ID: 39176114
What's the problem?  I always do this without having any problems so far.
0
 
LVL 7

Expert Comment

by:msifox
ID: 39176127
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.
0
 
LVL 26

Expert Comment

by:pony10us
ID: 39176131
@msifox

reminds me of the old days when using edit.com 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.  :)
0
 
LVL 3

Expert Comment

by:phoenix5ire
ID: 39176132
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
0
 
LVL 24

Expert Comment

by:aadih
ID: 39176142
Just like any copy and paste using mouse works. Am I missing something?
0
 

Accepted Solution

by:
Steve_Brady earned 0 total points
ID: 39176144
Thanks for the responses

>>pony10us
you can right click on the top (title) bar and go to edit/paste


Aha! That's nice to know. I'm so used to using Ctrl+v (which obviously does not work in DOS) that I was concerned it might not be possible.

FYI, I noticed that (in Windows 7) you can save a step by right-clicking anywhere in the black to get a menu with the option to Paste whereas right-clicking the title bar gives you Edit and then Paste in the next menu.
0
 
LVL 26

Expert Comment

by:pony10us
ID: 39176145
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.  :(
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 39181794
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).
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 39182115
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 :-)
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 11

Expert Comment

by:paultomasi
ID: 39192933
When you say 'command prompt' do you mean cmd.exe or command.com?

'CTRL-V' definitely pastes the clipboard's contents into a CMD box.
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 39193568
Paul, you are wrong. Ctrl-V pastes a ^V charachter (which is the ctrl-v character representation).
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 39194019
Agreed there Qlemo unless there is some setting I'm not aware of... would be useful sometimes if there was!
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39194119
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:
Alt+Spacebar
E
P

Open in new window

0
 
LVL 26

Expert Comment

by:pony10us
ID: 39194437
If you don't mind a third party app to be able to use CTRL+V you can always look at AutoHotKey:  http://www.autohotkey.com/  And a script for this function can be found:  http://www.howtogeek.com/howto/25590/how-to-enable-ctrlv-for-pasting-in-the-windows-command-prompt/
0
 
LVL 11

Expert Comment

by:paultomasi
ID: 39196536
Qlemo

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.
0
 
LVL 11

Expert Comment

by:paultomasi
ID: 39196565
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.
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 39207939
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).
0
 
LVL 26

Expert Comment

by:pony10us
ID: 39207963
Qlemo:

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.
0
 

Author Closing Comment

by:Steve_Brady
ID: 39218381
Thanks for all the responses and comments.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now