How to copy the folder structure and files into the destination using a Windows command?

18,235

How about that

xcopy "C:\Users\hpara\Desktop\Test" "C:\Users\hpara\Desktop\Foo\Test" /E /H /I

?

Share:
18,235
Ullan
Author by

Ullan

Updated on June 04, 2022

Comments

  • Ullan
    Ullan almost 2 years

    How to copy the folder structure and files into the destination using a Windows command?

    I tried the below, but the folder test is not copied, but all folders and files were copied:

    xcopy "C:\Users\hpara\Desktop\Test" "C:\Users\hpara\Desktop/Foo" /E /H /I
    
    • a_horse_with_no_name
      a_horse_with_no_name about 12 years
      Are you really using MS-DOS? Your path example seems to indicate some kind of Windows
  • Ads
    Ads almost 9 years
    This seems to result in a question for me : "Is this a file or a directory".. Hit "F" and it copies, but I have 100 or so individual files to copy...
  • Ads
    Ads almost 9 years
    Found a solution: echo f | xcopy file1.png .\subfolder\file1.png