How to copy a folder via cmd?

WindowsBatch FileCmd

Windows Problem Overview


I want to make a .bat file that when opened will copy a folder and all it contains into another folder on another partition. Here is exactly what I am trying to do:

Copy C:\Documents and Settings\user\Desktop\Документи and all it contains to D:\Backup. I have tried with many xcopy commands but without result. Thanks.

I launched the command prompt with /k and saw this

pic

which made me think there is a problem with the font. I installed new font that should fix this (YGP_NT) but I am having the same problem (yes, I changed it from the cmd Properties, edited the TrueTypeFont with regedit and restarted the PC). I can write in cyrillic in the cmd if that can help.

Windows Solutions


Solution 1 - Windows

xcopy "%userprofile%\Desktop\Документи" "D:\Backup\" /s/h/e/k/f/c

should work, assuming that your language setting allows Cyrillic (or you use Unicode fonts in the console).

For reference about the arguments: http://ss64.com/nt/xcopy.html

Solution 2 - Windows

xcopy  e:\source_folder f:\destination_folder /e /i /h

The /h is just in case there are hidden files. The /i creates a destination folder if there are muliple source files.

Solution 3 - Windows

xcopy  "C:\Documents and Settings\user\Desktop\Документи" "D:\Backup" /s /e /y /i

Probably the problem is the space.Try with quotes.

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
QuestionYordan SirakovView Question on Stackoverflow
Solution 1 - WindowsJoeyView Answer on Stackoverflow
Solution 2 - Windowsharry gatesView Answer on Stackoverflow
Solution 3 - WindowsnpocmakaView Answer on Stackoverflow