Copy all file in folder cmd

i want to copy all files and folders from one drive to another drive using MS-DOS. How to do it?

I am trying xcopy I:\*.* N:\ But it copies only files, not folders. So how to copy all files and folders both?

Thanks.

asked Aug 24, 2011 at 5:06

gautamlakumgautamlakum

11.6k23 gold badges66 silver badges89 bronze badges

2

xcopy "C:\SomeFolderName" "D:\SomeFolderName" /h /i /c /k /e /r /y

Use the above command. It will definitely work.

In this command data will be copied from c:\ to D:, even folders and system files as well. Here's what the flags do:

  • /h copies hidden and system files also
  • /i if destination does not exist and copying more than one file, assume that destination must be a directory
  • /c continue copying even if error occurs
  • /k copies attributes
  • /e copies directories and subdirectories, including empty ones
  • /r overwrites read-only files
  • /y suppress prompting to confirm whether you want to overwrite a file
  • /z Copies over a network in restartable mode.

more flags are found here //learn.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy

answered Aug 4, 2015 at 17:31

7

Use xcopy /s I:\*.* N:\

This is should do.

Tasawer Khan

5,8146 gold badges44 silver badges68 bronze badges

answered Aug 24, 2011 at 5:09

YahiaYahia

68.8k9 gold badges113 silver badges141 bronze badges

1

Use robocopy. Robocopy is shipped by default on Windows Vista and newer, and is considered the replacement for xcopy. [xcopy has some significant limitations, including the fact that it can't handle paths longer than 256 characters, even if the filesystem can].

robocopy c:\ d:\ /e /zb /copyall /purge /dcopy:dat

Note that using /purge on the root directory of the volume will cause Robocopy to apply the requested operation on files inside the System Volume Information directory. Run robocopy /? for help. Also note that you probably want to open the command prompt as an administrator to be able to copy system files. To speed things up, use /b instead of /zb.

answered Mar 8, 2016 at 20:45

FlimmFlimm

125k42 gold badges238 silver badges252 bronze badges

1

try this command, xcopy c:\ [file or directory path] F:\ /e. If you want more details refer this site [[//www.computerhope.com/xcopyhlp.htm]]

answered Sep 28, 2011 at 17:37

AerrowAerrow

12k10 gold badges55 silver badges90 bronze badges

This worked for me On Windows 10,

xcopy /s {source drive..i.e. C:} {destination drive..i.e. D:} This will copy all the files and folders plus the folder contents.

answered Jan 25, 2017 at 2:53

tamzitamzi

414 bronze badges

How can I copy all files in a folder?

Copy and paste files Right-click and pick Copy, or press Ctrl + C . Navigate to another folder, where you want to put the copy of the file. Click the menu button and pick Paste to finish copying the file, or press Ctrl + V .

How copy multiple files using CMD?

The copy command is used for complete files, if you want to copy a directory, or multiple directories containing files, use the robocopy or xcopy command. ... Windows Vista and later syntax..

Which command is used to copy all files?

Use the cp command to create a copy of the contents of the file or directory specified by the SourceFile or SourceDirectory parameters into the file or directory specified by the TargetFile or TargetDirectory parameters.

Chủ Đề