none
copy command to copy multiple files only copies the first file

    שאלה

  • hi friends

    i have a simple question and i'm sorry to ask that here. i didn't get any result after Googling and testing

    in win2008 R2 i want to copy 3 files from c:\ to  d:\folder2 , but none of the following commands works !! they only copy the first file.  what is the cause ?

    c:\>copy file1.txt + file2.txt + file3.txt  D:\folder2

    or

    c:\>copy file1.txt+file2.txt+file3.txt  D:\folder2

    where i am wrong ?

    thank in advance 


    • נערך על-ידי john.s2011 יום שלישי 28 פברואר 2012 08:06
    יום שלישי 28 פברואר 2012 08:06

תשובות

  • copy file1.txt d:\folder2 & copy file2.txt d:\folder2 & copy file3.txt d:\folder2


    Grant Ward, a.k.a. Bigteddy

    What's new in Powershell 3.0 (Technet Wiki)

    יום שלישי 28 פברואר 2012 08:12
  • c:\>copy file1.txt + file2.txt + file3.txt  D:\folder2

    The above command would almost work but it would do something other than what you had intended:

    copy file1.txt + file2.txt + file3.txt  D:\folder2\Result.txt

    It merges the three files and it puts the result into Result.txt. The difference between + and & is this:
    + will cause the files to be merged.
    & will cause several commands on one line to be executed one after the other, as if each command was on its own line

    • סומן כתשובה על-ידי john.s2011 יום שלישי 28 פברואר 2012 09:12
    יום שלישי 28 פברואר 2012 08:31

כל התגובות

  • copy file1.txt d:\folder2 & copy file2.txt d:\folder2 & copy file3.txt d:\folder2


    Grant Ward, a.k.a. Bigteddy

    What's new in Powershell 3.0 (Technet Wiki)

    יום שלישי 28 פברואר 2012 08:12
  • c:\>copy file1.txt + file2.txt + file3.txt  D:\folder2

    The above command would almost work but it would do something other than what you had intended:

    copy file1.txt + file2.txt + file3.txt  D:\folder2\Result.txt

    It merges the three files and it puts the result into Result.txt. The difference between + and & is this:
    + will cause the files to be merged.
    & will cause several commands on one line to be executed one after the other, as if each command was on its own line

    • סומן כתשובה על-ידי john.s2011 יום שלישי 28 פברואר 2012 09:12
    יום שלישי 28 פברואר 2012 08:31
  • c:\>copy file1.txt + file2.txt + file3.txt  D:\folder2

    The above command would almost work but it would do something other than what you had intended:

    copy file1.txt + file2.txt + file3.txt  D:\folder2\Result.txt

    It merges the three files and it puts the result into Result.txt. The difference between + and & is this:
    + will cause the files to be merged.
    & will cause several commands on one line to be executed one after the other, as if each command was on its own line

    hi pegasus

    thank you very much for your great explanation

    regards

    יום שלישי 28 פברואר 2012 09:12
  • copy file1.txt d:\folder2 & copy file2.txt d:\folder2 & copy file3.txt d:\folder2


    Grant Ward, a.k.a. Bigteddy

    What's new in Powershell 3.0 (Technet Wiki)

    hello Bigteddy

    thank you very much for great syntax

    regards

    יום שלישי 28 פברואר 2012 09:13