how to robocopy files with similar names

Page 1 of 2 12 LastLast

  1. Posts : 2
    win 7
       #1

    how to robocopy files with similar names


    Hello all,

    I need to robocopy many files which starts with the same name for Example (Ari, Arit, Ariel, Arik, Aris)
    I tried robocopy source_file\ari*.* destination_file\ari*.* however it is nto working do someone can help with that.

    Thanks Orfi
      My Computer


  2. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #2

    Hi,

    Your syntax is a bit out. Try this:

    Code:
    robocopy E:\Test\ Ari* F:\Test\ /e /mir
    Regards,
    Golden
      My Computer


  3. Posts : 1,814
    XP / Win7 x64 Pro
       #3

    Wildcards don't work with robocopy. You'll have to use xcopy, which is also built in.
      My Computer


  4. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #4

    Hi FliGi7,

    It is possible to use wildcards, but I agree its less intuitive than copy or xcopy - the trick is to include a space between the source and wildcarding.

    Additionally, there is an exclude option (/XF) that will exclude files based on paths/names and a series of wildcards.

    Regards,
    Golden
      My Computer


  5. Posts : 2
    win 7
    Thread Starter
       #5

    almost there


    Golden thank you for the help, however if I will have space between the
    E:\Test\ Ari.

    Directory test to Ari it is copying all the folders that I have in folder test.

    Any thoughts.

    Orfi
      My Computer


  6. Posts : 2,171
    Windows 7 Ultimate x64
       #6

    You might have to try it specifically as Golden described. You're missing the "*" in the command in your post.

    It would be helpful if you posted the whole command line you're using...
      My Computer


  7. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #7

    Hi,

    If you mean its copying all the files, instead of just those starting with the characters Ari, then include the * as sibbil mentioned.

    If you mean its copying all the folders, then you can use the /XD switch to exclude specific folders.

    I agree with sibbil, its far easier to help you if you post exactly the command line you are using.

    Regards,
    Golden
      My Computer


  8. Posts : 640
    Windows 7 Ultimate x64
       #8

    Orfi said:
    Directory test to Ari it is copying all the folders that I have in folder test.
    I think you might be saying that it's coping the subfolders as well and if they don't have a matching file you end up with a empty folder.
    Try this instead
    Code:
    robocopy E:\Test\ Ari* F:\Test\ /s
      My Computer


  9. Posts : 1,814
    XP / Win7 x64 Pro
       #9

    Golden said:
    Hi FliGi7,

    It is possible to use wildcards, but I agree its less intuitive than copy or xcopy - the trick is to include a space between the source and wildcarding.

    Additionally, there is an exclude option (/XF) that will exclude files based on paths/names and a series of wildcards.

    Regards,
    Golden
    Wow, totally didn't know that! I just assumed they didn't work whenever I tried to do something like "C:\Path\*file.*" because it never worked. I wish that "trick" was documented on the man page. They infer that wildcards work like in any other instance, which they obviously do not.
      My Computer


  10. Posts : 2,171
    Windows 7 Ultimate x64
       #10

    FliGi7 said:
    Wow, totally didn't know that! I just assumed they didn't work whenever I tried to do something like "C:\Path\*file.*" because it never worked. I wish that "trick" was documented on the man page. They infer that wildcards work like in any other instance, which they obviously do not.
    If I do a robocopy/? it specifies a space is required before and after file specification, using wildcards or not. *.* is the default if no file specified.

    And I guess the "odd" syntax comes from the program being designed for handling directory replication rather than the typical file manipulation.
    Last edited by F5ing; 13 Apr 2012 at 18:34. Reason: added more info.
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 14:54.
Find Us