قالب وردپرس درنا توس
Home / Tips and Tricks / Copy or move files and folders in Windows 10

Copy or move files and folders in Windows 10



  Microsoft Windows Logo

Windows offers many ways to copy and move files. We'll show you all the tricks for Explorer and how to use them in Command Prompt and PowerShell. You can even add "Copy To" and "Move To" to the File Explorer's context menus.

When you copy a file or folder in Windows 1

0, a duplicate of the selected item is created and saved in a destination folder of your choice. . However, when you move a file or folder, the original item is moved to the destination folder instead of sending an identical copy.

Copying or moving files with drag and drop

One of the most common methods to copy or move a file or folder to drag and drop it into the destination folder. By default – depending on the location of the destination folder – File Explorer can move it instead of copying it, or vice versa. However, there is a hidden method that suppresses Windows default behavior.

Open the file explorer by pressing Windows + E and navigate to the file you want to copy.

 Open the File Explorer to the files you want to copy

When you drag files from one folder to another, you can use the panel on the left or open another copy of File Explorer to go to the destination folder to navigate. For this example, we will use a second File Explorer window to copy files.

Open a second File Explorer window by pressing Windows + E and navigate to the destination folder.

 Open a second File Explorer and select the files you want to copy.

Windows has two default actions when you drag and drop a file or folder to a new destination: copy or move. Copying occurs when you drop the file or folder into a folder on a other drive. Movement occurs when you drop it on the same disk, as we will do below. However, there is a hidden trick that forces Windows to perform a specific action.

To copy files to another drive, highlight the files you want to copy, click and drag them to the second window, and then drop them.

 Drag the files to the second window and drop them.

If you are trying to copy the files to a folder on the same drive, click on it and drag them to the second window. However, before dropping them, press Ctrl to activate copy mode.

 To copy a file to the same drive, press Ctrl before dropping it in the window.

To move files to a different folder on the same disk, mark the files you want to move, click and drag them to the second window and then drop them.

 Click and drag the files to the second window.

If the destination folder is on another drive, click and drag them as before to the second window, but this time press Shift to activate the move mode.

 Move files to a folder on another drive, click and drag them, but before you drop the function, press Shift.

Copy or move files with Cut, Copy and Paste

You can also copy and move files with the clipboard, just as you cut, copy and paste text.

Open File Explorer by pressing Windows + E and navigate to the file you want

 Open File Explorer and navigate to the folder of files you want to copy.

Highlight the files you want to copy, then click "Copy" on the File menu or press Ctrl + C on the keyboard to add them to the clipboard.

 Mark the files and click on

If you prefer to move items, mark the files you want to move. Then click "Cut" on the File menu or press Ctrl + X to add the files to the clipboard.

 Select the files and click

Navigate to the folder you want to move the files to, then click "Paste" on the "Home" tab or press Ctrl + V. Depending on whether you click "Copy" or "Cut", your files will be copied or moved respectively.

 Navigate to the destination folder and click

Copy or move files and folders using the context menu [19659005]   Windows 10 context menu with

When you right-click on a file or folder, Windows has a number of hidden context menu functions that allow you to add two options: Copy To or Move To. By adding these two functions to the context menu, you can copy or move items with just a few clicks.

RELATED: How to Add "Move To" or "Copy To" to Windows 10's Context Menu

Copy or Move Files Using the Command Prompt

One of the Fastest Ways to opening a command prompt in the desired folder is from explorer. First open File Explorer and navigate to the destination. Click on the address bar, type " cmd " and press Enter.

RELATED: 10 Ways to Open the Command Prompt in Windows 10

 Type from Explorer

To copy a file, you can use the following command syntax (if you are copying a folder, just omit the file extension):

  copy " filename.ext "" full  path  to  destination folder "

The quotation marks in the command are important only when the file name or folder contains spaces. If they don't have spaces, you don't need to include the quotes. In the example below, neither the file name nor the folder contain a space, so we didn't have to use them.

 The file is copied to the destination folder.

You can also use the command copy to duplicate multiple files at the same time. Separate each file with a comma, then specify the destination folder as you normally would.

 Separate multiple files with a comma to copy them over.

To move a file, you can use the following command syntax (if you move a folder, just omit the file extension):

  move "filename.ext" "complete  path  to  target  folder "

As with copying, the quotes in the command are important only if the file name or folder contains spaces. If not, you don't need to include the quotes. In the example below, neither the file name nor the folder contain a space, so we didn't have to use them.

 The command moves the file.

However, if you try to move multiple files, as we did with the command copy the command prompt gives a syntax error.

 Using a comma to move more than one file does not work and the command prompt will throw an error

There are some other ways to move more than one item at a time using from the command prompt without throwing an error. Each method uses a wildcard to move multiple files within one statement.

If you want to move a specific file type first, you can use the following syntax to move the files:

  move *. ext "full  path  to  folder" 

 Use a wildcard to move all files with a specific extension type.

The second method involves moving everything within the source folder, regardless of the file type. You can use the following syntax to complete the move:

  move * "full  path  to  directory" 

 Move any file in the folder.

Copying or moving files with PowerShell

Windows PowerShell is even more powerful and flexible than the command prompt when it comes to copying or moving files and folders in a command line environment. While we're only going to surface, you can do some really powerful things with cmdlets.

The fastest way to open a PowerShell window in the desired location is to first open the folder in File Explorer. In the "File" menu, click "Open Windows PowerShell" and then select "Open Windows PowerShell".

RELATED: 9 Ways to Open PowerShell in Windows 10 [19659003]   Click File> Open Windows PowerShell> Open Windows PowerShell. "Width =" 541 "height =" 318 "src =" / pagespeed_static / 1.JiBnMqyl6S.gif "onload =" pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon (this); "onerror =" this.onerror = null; pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon (this); "/> </p>
<p>  Use the following syntax to copy a file or folder in PowerShell: </p>
<pre>  Copy-Item" filename.ext "" path  to  destination  folder "</pre>
<p>  Although not required , the <code> Copy-Item </code> cmdlet only requires quotes around the filename and folder if they contain spaces. </p>
<p>  For example, to copy a file from the current folder to another, use the following command: [19659041] Copy-Item Lex.azw D:  Downloads </p>
<p>  <img class=

The real power of PowerShell comes from the ability to merge cmdlets For example, suppose we have a folder with some ebook subfolders we want to copy.

Instead of changing the folder and running the command again, we can have PowerShell scan through each folder and subfolder , and then copy a specific file type to the destination.

We can use the following cmdlet:

   Get-ChildItem    -Path    ".  *. Azw"    -Recurse  |  Copy-Item    -Destination    "D:  Downloads"  

The Get-ChildItem section of the cmdlet contains all files in the current directory and all subfolders (with the -Recurse switch) with the AZW file extension and directs them (the | symbol) to the Copy-Item cmdlet. [19659003]   After entering the command, PowerShell searches all subfolders and copies everything within the specified file extension.

To move files, you can use the following syntax to move anything you want:

  Move-Item Lex.azw D:  Downloads 

 The item has been moved .

Move-Item follows the same syntax as the Copy-Item cmdlet. So if you want to move all specific file types from a folder and all subfolders – like we did with the Copy-Item cmdlet – it's almost identical.

Type the following cmdlet to move all files of a specific file type from a directory and its subfolders:

   Get-ChildItem    -Path    ".  *. Azw"    -Recurse  |  Move-Item    -Destination    "D:  Downloads"  

 Move files in PowerShell.




Source link