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 MVP

Windows 7 Ult. 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 MVP

Windows 7 Ult. 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 MVP

Windows 7 Ult. 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
Thread Forum
Robocopy not copying My Document files
Hi, I just started using Robocopy to backup my files to my JBOD recently and I noticed that it does not copy anything in My Document folder. Here is the result log for Robocopy regarding the backup. Even though it says that it copied 22831 files the destination folder says it has not been modified...
Backup and Restore
Used Robocopy and deleted my files - how can I recover them?
Hi I've just re-organised my hard drives and I've set up a batch routine to backup my files, using Robocopy. However, as I swapped my drives around, I've copied in the wrong direction. Robocopy has consequently deleted entire folders of important data. The data isn't in the recycle bin. ...
Backup and Restore
Robocopy / view backed up files on external drive
Started using robocopy to do my backups. In my command lines, i can specify directories on a external drive to backup to.Some directories show up and i see everything. My most important directory " my documents" DOESNT SHOW UP. I have confirmed a backup is occuring, via log file and properties on...
General Discussion
How to compile a text file or similar regarding files?.
I have so many films and music, how do i compile a list of them into a text file or some other format for catalogue use? , i hate using catalogue software.
General Discussion
Backing up files using Robocopy
The default copy switch of robocopy is /COPY:DAT if you don't specify any copy options. This is the code I'm using: robocopy C:\ D:\Backup RAMDisk.img /copyall /R:5 /W:15 /V /log:D:\Users\Kevin\Desktop\robocopy_log.txt The RAMDisk.img file that I'm copying is a compressed image file. Now with...
Backup and Restore
How to Robocopy my files to Linkstation.
I have setup a bat file to copy my files to the linkstation. As Below: Robocopy "C:\Users\User\Documents\Janine" "B:\Documents\Janine" /MIR /E /SEC But when it gets to certain files it says access denied. How do I get it to copy these files with permissions...
General Discussion


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 16:21.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App