?
Solved

Paste commands into a DOS prompt rather than typing them

Posted on 2013-05-17
21
Medium Priority
?
332 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
20 Comments
 
LVL 26

Assisted Solution

by:pony10us
pony10us earned 2000 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
[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
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 72

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
 
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 72

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 46

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 72

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoHotkey is an excellent, free, open source programming/scripting language for Windows. It started out as a keyboard/mouse macros product, but has expanded into a robust language. This article provides an introduction to it, with links to addition…
This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

571 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