Windows commands copy and paste

Windows copy command syntax and examples

Using copy command, we can copy files from one directory to another directory. This command is similar to the Linux cp command, but it does not match with the full functionality of cp. Windows copy command can be used to copy files only, we can’t copy directories.

The syntax and usecases of copy command are explained below with examples.

Copy the contents of a file to another file

Example: To copy a file from c:\data\file1.doc to D:\backup\file2.doc

If the destination file already exists you will be prompted for confirmation. To suppress this confirmation you can use /Y switch with copy command. This would be useful if you are executing copy command from a batch file.

If the destination file exists, the above command will overwrite the same without asking the user for confirmation.

Copy file to another directory

When we specify a directory path as the destination, the files will be copied with the same name. We can assign a different name by specifying the new name in the destination path. Example is shown below.

To copy the file 1.doc loated at c:\data\documents to the directory c:\data\newdocs

Copy files with white space in name

If the file name has white space within it, we can wrap up the name in double quotes.
Example: To copy file, my resume.doc to another folder

Copy multiple files

We can’t specify multiple file names in copy command. However, we can use wildcards to identify a group of files and then copy all of them in a single command.
For example, to copy all excel files from current folder to another folder F:\backup

To copy all files in current folder to another folder

Use of environment variables

We can use environment variables in the copy command to specify the path of the folders. Like USERPROFILE, SystemRoot, ProgramFiles, TEMP, WINDIR, APPDATA, HOMEPATH.

For example, to copy a file to a user’s documents folder

The above command copies the file to the My Documents folder of the current logged in user.

You may also want to read

Windows «copy» is funny. Type «copy 1 2» and the file «1» will be copied into a new file «2». Now separate them by a plus sign instead of a space (copy 1+2) and you’ll concatenate 1 and 2 and replace the old file «1» with the result of the concatenation!

Yes, we can concatenate two or more files using copy command. You need to separate the list of files using +. You can redirect the resultant data to a new file also.

The above command will not alter the file 1. It creates a new file 3 with the concatenated data of 1 & 2. If no file name is provided it stores the result in the first file.

My Win7 cannot find a copy command, and when i run xcopy, a window flashes and exits.

Читайте также:  Как передать файл через командную строку windows

I have the same problem. If you solved it, could you please explain how?

If you can not find your copy.exe file, you can download it to your windows directory or C:\ Directory depending the setting on your OS you should also be able to copy and run it from system32 or system folder.

how can i combine 2 .exe files and be able to use both after concatenation

I want to copy 2 different files(.exe,.config) from source to destination server of windows.
can you please help me on this command.

Hello i have a problem with my cmd windows 7.when i try to copy a command. Like help > file.pdf. i mean in extension pdf because i have this problem only with .pdf extension but not with .txt.So whe i execute the command. No problem. Then when i go to open the file.pdf ftom user destination the file.pdf doesn’t open say that is corrupted.please do help me .thanks

i have a file contain many lines as sources and another file has the same numbre of lines as destinations. i want to copy first line as source( c:/test/*.txt) to first line in destination ( d:/test2/), secend line ( c:/test/*.pdf) to second line in destination ( E:/test3/)……

Can I use the DOS/Windows “COPY” command in a BAT file to copy a file or a short string of text to computer memory and then paste (Ctrl +V) that string or file into a document?

How to Enable Copy-Paste in Windows 10 Command Prompt

One of the annoying problems with the Windows Command prompt is that it doesn’t let you copy-paste stuff inside. To address this, we bring you the latest guide to enabling copy and paste functionality within the command prompt in Windows 10.

We will also discuss command line text selection and current line clearing, as they go hand in hand with copy-paste techniques. Put together, all these workarounds can help you leverage the command prompt as a typical Word processor tool.

Note: these tips should work best for Windows 10, latest versions 1909 or 1903. If you haven’t upgraded from earlier Windows 10 versions, consider doing it right now from “System Settings ->Check for Updates.” In case of any trouble, you can self-diagnose and resolve any pending issues using the Update Troubleshooter or SetUpDiag.

Enable CTRL + V in Windows Command Prompt

We will first examine how to resolve the CTRL + V issue in the command terminal, as it is easier to fix. Always ensure that your system is up to date.

1. Right-click anywhere in the command prompt and select “Properties.”

2. Go to “Options” and check “Use CTRL + SHIFT + C/V as Copy/Paste” in the edit options.

3. Click “OK” to save this selection. It should now effectively enable the copy-paste commands in the Windows command prompt.

Check for any suitable browser text or other legitimate code online. You may copy this selection using either right-click “Copy” or Ctrl + C , whichever you find easier.

4. Use the approved keyboard shortcut Ctrl + Shift + V to paste the text inside the terminal. You can also paste using a right-click.

5. You can also use the simpler Ctrl + V for pasting without the confusing Shift key. Such variations don’t really make sense except to Windows developers! Thus, if there are any issues, always go back to Ctrl + Shift + V as a default for paste.

Enable CTRL + C within Command Prompt Text

Using CTRL + C within the Command Prompt is a bit more complex than CTRL + V. That’s because you cannot select any of the text using a mouse cursor display. Fortunately, there is a workaround for this.

1. Use either Ctrl + A or “Select All” from a right-click menu to highlight the entire text in the command prompt. This is just a simple tweak to select a given text line for copying.

Читайте также:  Куда загружать шрифты для windows

2. Simply release the mouse. It will deselect the entire screen, but a tiny mouse cursor display is activated.

3. You can easily select any line item within the terminal, and it will take the property of the mouse cursor display. Whether you use a laptop trackpad or a proper mouse, there is a pointer that can select as much or as little of the target text as you want.

You can use the above trick to select any line of text as shown here. This can now be copied using Ctrl + C . Unfortunately, right-click may not work, as it simply deselects everything, and then you will have to repeat the procedure again. Because of this, it’s recommended to use the Ctrl + C shortcut. You can also use Ctrl + Shift + C if needed.

The following image shows the simultaneous use of “CTRL + C/CTRL + V” in the command terminal window itself.

Other Important Text-Editing Keys in Cmd

Apart from CTRL + C/CTRL + V, you should know how to fix a few simple editing errors in the command terminal. One of the common errors is copy-pasting the wrong code or a typo. Of course, you can hit backspace, but it can be time-consuming for a long line of code.

Simply hit the ESC key on your keyboard, and the error line will disappear.

All the text in a current line can be cleared using the ESC key.

Likewise, using the cls command will wipe the entire command terminal clean.

By default, Windows 10 copy-paste does not work from either the right-click or keyboard shortcuts. This is such a vital function, but for strange reasons, many users complain that they are unable to use CTRL + C/CTRL + V in the Windows command line.

Now that you know how to copy and paste in the command prompt, you can proceed to set up commands to run automatically at command prompt start or master this list of command prompt tricks.

Related:

Sayak Boral is a technology writer with over ten years of experience working in different industries including semiconductors, IoT, enterprise IT, telecommunications OSS/BSS, and network security. He has been writing for MakeTechEasier on a wide range of technical topics including Windows, Android, Internet, Hardware Guides, Browsers, Software Tools, and Product Reviews.

How to Copy and Paste in the Windows 10 Command Prompt

By Melanie Pinola 20 November 2015

With Windows 10, Microsoft finally updated the long-neglected command prompt. You can now quickly select and paste text within the command prompt window, but first you have to enable the keyboard shortcuts. Here’s how to do it.

Previously if you wanted to copy and paste in the command prompt you had to jump through hoops: Open the context menu with the Alt+E keyboard combination, go to Edit > Mark to tell Windows you want to mark text to select, and then use a lasso tool to create a box around the text you wanted to select. You needed to go back into the context menu to copy and to paste.

The upgraded command prompt in Windows 10 is much simpler. You can copy and paste with the familiar CTRL + C to copy and CTRL + V to paste keyboard shortcuts. To get this functionality, head to the application’s properties settings.

1. Open Command Prompt. The quickest way to do this is to click the Windows key, type in cmd, and hit Enter or clicking on the app.

2. Right-click on the command prompt’s title bar and choose Properties

3. Uncheck the box next to «Use legacy console (requires relaunch)». This should automatically check the «Enable Ctrl key shortcuts» option.

Читайте также:  Как узнать мой номер сети windows

4. Click OK.

Now you can select text using your mouse or the keyboard (hold down the Shift key and use the left or right arrows to select words). Press CTRL + C to copy it, and press CTRL + V to paste it in the window. You can also easily paste text you’ve copied from another program into the command prompt using the same shortcut.

Once you’ve got copying and pasting in the command prompt down, check out our guides on how to map a network drive to quickly share files and how to enter the BIOS to access critical settings.

iSumsoft

Tell You More about IT World

  • Blog>
  • Windows 10>
  • How to Copy and Paste in Command Prompt on Windows 7/10

How to Copy and Paste in Command Prompt on Windows 7/10

Usually, we enter commands manually in the Command Prompt on Windows 10/8/7. In fact, you can directly copy and paste text in Command Prompt if you want, which will save your time. Now, this post will show you how to copy and paste in Command Prompt on Windows 7/10.

Part 1: How to copy and paste in Windows 7 Command Prompt

By default, you cannot select or copy and paste text in the Command Prompt (or CMD) in Windows 7, before you enable its QuickEdit mode.

Step 1: Enable QuickEdit mode in Command Prompt

1) Open a Command Prompt (or CMD) window.

2) Right-click on the window’s title bar, and select Properties from the menu.

3) In the Properties dialog, select the Options tab, then check the QuickEdit Mode option under Edit Options, and click OK.

Step 2: How to copy and paste in Windows 7 Command Prompt

1) Select to highlight any text in the CMD window, using your left mouse button.

2) Press your right mouse button, or press the Enter key on your keyboard, or right click on the CMD window’s title bar and select Edit > Copy, so that the selected text can be copied.

3) Right-click in the command prompt window or right click on the window’s title bar and select Edit > Paste so that the selected text can be pasted onto your mouse cursor’s location in the CMD window. If you want to paste the selected text from the CMD window to another program or location, use Ctrl + V keyboard shortcuts.

4) Copy any text from another program or location, then right click in the Command Prompt window, or right click on the window’s title bar and select Edit > Paste, to paste the selected text onto the CMD window.

Part 2: How to copy and paste in Command Prompt on Windows 10

By default, you can freely select text or use Ctrl + C and Ctrl + V to copy and paste text in the Command Prompt (or CMD) of Windows 10. But if this feature is disabled by someone, you can enable it.

Step 1: Open a Command Prompt (or CMD) window.

Step 2: Right-click on the window’s title bar, and select Properties.

Step 3: In the Properties dialog, select the Options tab, uncheck Use legacy console (requires relaunch), keep the options under Edit Options and Text Selection checked, and then click OK.

Step 4: Close the current command prompt window, and relaunch the Command Prompt for the changes to take effect.

So, you can freely use the Ctrl + C and Ctrl + V to copy and paste text in a Command Prompt window, or between multiple CMD windows, or between a Command Prompt window and other programs.

Оцените статью