Telling XCOPY to copy hidden folders as well as hidden files

[亡魂溺海] 提交于 2019-12-10 14:43:48

问题


I'm trying to get XCOPY to copy an entire directory tree and all its files, however, one of the directory paths includes a hidden folder, and although you can use the /h parm to specify copying hidden files, this doesn't seem to apply to hidden folders. I've been all over the docs for XCOPY and there doesn't seem to be one that deals with hidden folders. But perhaps someone knows differently?

`xcopy c:\profiles c:\aprofiles /r /e /h /v /y 

The above works fine except for the hidden folders. I suppose that I could change the hidden folders to make them non-hidden, but there are a few hundred of them.


回答1:


As @xanatos says, it copies hidden folders in Windows 7.

I couldn't get it to copy hidden folders in Windows 2003 Server, yes, even using the /h switch. Hidden files, yes, but not hidden folders.

Weird.




回答2:


Try adding /s. /e should be taking care of that, but doesn't appear to be doing so. I just tested this with a /s and it gave me the hidden folders of a user's profile, as well as all the content of each.



来源:https://stackoverflow.com/questions/7812037/telling-xcopy-to-copy-hidden-folders-as-well-as-hidden-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!