copy all files and folders from one drive to another drive using DOS (command prompt)

FileFilesystemsBackupDosCopy Paste

File Problem Overview


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.

File Solutions


Solution 1 - File

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 https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy

Solution 2 - File

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

This is should do.

Solution 3 - File

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.

Solution 4 - File

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

Solution 5 - File

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiongautamlakumView Question on Stackoverflow
Solution 1 - FileSHABAZ KHANView Answer on Stackoverflow
Solution 2 - FileYahiaView Answer on Stackoverflow
Solution 3 - FileFlimmView Answer on Stackoverflow
Solution 4 - FileAerrowView Answer on Stackoverflow
Solution 5 - FiletamziView Answer on Stackoverflow