Xcopy *.* C:\somedirectory\
If I try the same in Robocopy I get a an error
"No Destination Directory Specified"
It's true ROBOCOPY doesn't handle wild cards, but what you're after is still possible:
Say I want this:
C:\temp> robocopy *.* c:\temp2\
I'll get the error you get - "No Destination Directory Specified"
BUT, if you try this:
C:\temp> robocopy c:\temp\ c:\temp2\
ROBOCOPY will work and do what your after. Quotation marks can also be used in the above path references.
I suppose one of the reasons for the lack of wildcard support is the fact that ROBOCOPY actually works to exclude files types later with the /XF switch (such as "/XF *.mp3"). More here.
Hope this helps, Kevin @calwell on twitter.
- Marked as answer by Nicholas LiModerator Friday, February 12, 2010 4:45 AM
Thanks, Kevin @calwell on twitter
Wow, I've never heard of HoboCopy. It looks pretty good - for me, I normally don't need all the switches in a product like Robocopy; and I like the VSS integration that Hobocopy has.
My use now is limited to copying application files for installation on a Windows 7 image. We use the Microsoft Deployment Toolkit to create our images and install the apps we need. Some of our apps are very old and we install them by copying them to the local machine (during image creation) and then running come vbscripts to craeat shortcuts for them. We're try ing to standardize on Robocopy instead of xcopy.
That's all good.. for what you describe robocopy would have no problem handling that task. There are a number of great uses for robocopy and hobocopy in terms of backup.. one type of use (for example) is when used backup a user's documents folder:
robocopy "%USERPROFILE%\Documents" "H:\localfiles\Documents" /E /PURGE /V /NP /XF *.mp3 *.m4a *.pst *.tmp *.avi *.wav /R:10 /W:30
or with hobocopy backing up data (in an accounting directory) to an external drive:
HoboCopy /statefile=z:\backup\accounting\directcopy\hbstate /incremental /skipdenied /y /r d:\accounting\ z:\backup\accounting\directcopy\ > z:\backup\accounting\DirectLog.log
Thanks, Kevin @calwell on twitter
You can use "." to specify that you want to copy from/to the current directory.
For example,
//this copies all files from the current directory to C:\some\other\path
robocopy . C:\some\other\path
//and the other way around
robocopy C:\some\other\path .
You can also use ".." to specify that you want to copy from/to the parent directory.
For example,
//this copies all files from the current directory to the parent directory
robocopy . ..
//this copies all files from the directory which is two levels up to the parent directory
robocopy ..\.. ..
You can use this with xcopy as well.
Note that "." and ".." are not specific to robocopy or xcopy, see en.wikipedia.org/wiki/Path_(computing)
Hope that helps.
- Edited by G. Costanza Tuesday, July 29, 2014 9:48 AM
One reason why I had to switch from using xcopy to robocopy was that xcopy doesnt work for long folder path.
It gives an error "Insufficient Memory" when the total characters exceed a certain limit. Robocopy doesnt have that limitation.
Also, in many other ways its definately an upgrade.. ;)