Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: how to robocopy files with similar names


09 Apr 2012   #1
Orfi

win 7
 
 
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 System SpecsSystem Spec
09 Apr 2012   #2
Golden

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

Hi,

Your syntax is a bit out. Try this:

Code:
robocopy E:\Test\ Ari* F:\Test\ /e /mir
Regards,
Golden
My System SpecsSystem Spec
09 Apr 2012   #3
FliGi7

XP / Win7 x64 Pro
 
 

Wildcards don't work with robocopy. You'll have to use xcopy, which is also built in.
My System SpecsSystem Spec
09 Apr 2012   #4
Golden

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

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 System SpecsSystem Spec
10 Apr 2012   #5
Orfi

win 7
 
 
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 System SpecsSystem Spec
10 Apr 2012   #6
F5ing

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
10 Apr 2012   #7
Golden

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

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 System SpecsSystem Spec
10 Apr 2012   #8
Duzzy

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by Orfi View Post
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 System SpecsSystem Spec
13 Apr 2012   #9
FliGi7

XP / Win7 x64 Pro
 
 

Quote   Quote: Originally Posted by Golden View Post
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 System SpecsSystem Spec
13 Apr 2012   #10
F5ing

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by FliGi7 View Post
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.
My System SpecsSystem Spec
Reply

 how to robocopy files with similar names




Thread Tools



Similar help and support threads for2: how to robocopy files with similar names
Thread Forum
Solved How to delete names of already deleted files. General Discussion
Solved Robocopy / view backed up files on external drive General Discussion
Solved How to compile a text file or similar regarding files?. General Discussion
Backing up files using Robocopy Backup and Restore
How to Robocopy my files to Linkstation. General Discussion
Solved How do I get rid of files with illegal names Performance & Maintenance

Our Sites

Site Links

About Us

Find 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 11:27 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App