Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy a folder via cmd? [closed]

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.

like image 592
Yordan Sirakov Avatar asked Oct 22 '13 12:10

Yordan Sirakov


People also ask

How do I copy a whole folder in CMD?

Type "xcopy", "source", "destination" /t /e in the Command Prompt window. Instead of “ source ,” type the path of the folder hierarchy you want to copy. Instead of “ destination ,” enter the path where you want to store the copied folder structure. Press “Enter” on your keyboard.

How do I copy a folder in DOS mode?

To copy a directory in MS-DOS, use the xcopy command.

Can not copy from CMD?

Make sure the Enable Ctrl key shortcuts option is checked. You can also check the Use Ctrl+Shift+C/V as Copy/Paste option. Click OK to save the setting. Then you should be able to use the keyboard shortcut Ctrl + C and Ctrl + V to copy and paste in Command Prompt window.


1 Answers

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

like image 83
Joey Avatar answered Oct 09 '22 22:10

Joey