skipping files in use when copying nested folders

Posted on 2005-05-11
Last Modified: 2010-04-14
When copying a folder with nested subfolders is there any way to just skip over any files that may be protected or in use. It seems like quite often when I go to do this, I get an error and the copying won't continue. I then have to find the file since the error message doesn't give me the location.
Question by:BobArnett
    LVL 16

    Accepted Solution

    I would use xcopy with the /c (continues if errors occur), /h (copy hidden), /e (copy everything including empty folders), /d (only copy file if source is newer than destination), /y (override). By typing xcopy /? in a ms-dos window it will explain all the variables and such. Very informative.

    xcopy "source" "destination" /h /e /d /c /y
    xcopy "%userprofile%\my documents\*" "d:\backup\my documents\" /h /e /d /c /y
    xcopy "%userprofile%\desktop\*" "d:\backup\desktop\" /h /e /d /c /y
    xcopy "%userprofile%\favorites\*" "d:\backup\favorites\" /h /e /d /c /y

    xcopy "%userprofile%\my documents\*" "\\server\share\%username%\my documents\" /h /e /d /c /y

    LVL 32

    Expert Comment

    I like the xcopy solution myself, but if you must use a GUI, see:


    Author Comment

    I would have liked the GUI utility but I couldn't get it to work. I'll probably write a small (WinBatch) script to run the xcopy command. Thanks for the tip.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Suggested Solutions

    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now