Telling XCOPY to copy hidden folders as well as hidden files

25,899

Solution 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.

Solution 2

funny I was just trying to xcopy and had the same issue, i know this is 7 years late but it might help

using /h /s /e seems to copy hidden files and directorys correctly

Share:
25,899
NewXcoder
Author by

NewXcoder

Who, Me? I am a retired software developer. I started out as a mainframe COBOL programmer back in 1987. Transitioned to VB6 in 2000, .NET when Visual Studio 1.0 was in Beta2. I'm a American expatriate living primarily in the UK at this time. I operate a publishing company in order to publish two books about family members' experiences in and after World War II in Germany (and the Soviet Union). Check it out: Prospect Avenue Books. Twitter: @Cyberherbalist Blogs: see my website profile for Cyberherbalist on Stack Exchange, a network of free, community-driven Q&A sites http://stackexchange.com/users/flair/9228.png

Updated on July 09, 2022

Comments

  • NewXcoder
    NewXcoder almost 2 years

    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.