1

I have a folder repeated in all partitions, with the same name but different contents. I need to copy these folders to another partition in a few lines of code, but not once for each partition, such as

Xcopy c:\userroot\storage G:\backup\

This would need to be repeated for many partitions: C D E F H I..... Many lines. Can't I condense these lines into one, or two at most?

4
  • You can use a FOR construct with variable substitution. I have never been able to wrap my head around Microsoft's FOR syntax, though. You will need to know the list of partitions you want to copy the directory to, but it should reduce what you want to do to a single command line.
    – user
    Oct 23, 2015 at 9:09
  • Also, did you really mean to tag this MS-DOS? Because MS-DOS is a legacy operating system that hasn't been in common use for 20 years. Note that the command line of current Windows operating systems is very distinctly not MS-DOS.
    – user
    Oct 23, 2015 at 9:10
  • Thanks Micheal but i searched in tag didn't find dos i found ms-dos Oct 23, 2015 at 9:24
  • Could yoy please write example for a for command in this case. Oct 23, 2015 at 9:25

0

You must log in to answer this question.

Browse other questions tagged .