Xcopy /H issues

leo2kp

Distinguished
Hey all, having a strange issue that the Google doesn't seem to be familiar with. I'm trying to build a script to copy files from one HDD to another using XCOPY. What I'm finding is that it's not copying all of the hidden files even with the /H switch if the files are several folders deep, but it works if I specify a directory with both hidden and unhidden files. Example:

xcopy d:\data z:\d\data /H /I /D /E
The above will miss hidden files in d:\data\music\artist\ but will copy other files just fine

xcopy d:\data\music\artist z:\d\music\artist /H /I /D /E
This will copy the hidden files from this location


There don't seem to be any switches to specify folder depth. I'm at work so I don't have the exact syntax in front of me, but I believe I inserted quotes around the source and destination strings because there were spaces in the file names, but the the unhidden files still copy over so I didn't think that was the issue.

I hope someone has some expert knowledge of xcopy that they can impart!
 
Solution
I cannot offer a solution since... Upon testing your xcopy line, it works, including hidden files deeper in the folder structure. (\logs\test\duh\test2\test3)
each folder has both hidden and normal files and all copy over just fine as long as they are newer than in the destination (as specified by /D)
I cannot offer a solution since... Upon testing your xcopy line, it works, including hidden files deeper in the folder structure. (\logs\test\duh\test2\test3)
each folder has both hidden and normal files and all copy over just fine as long as they are newer than in the destination (as specified by /D)
 
Solution