XCopy question for moving a file share and permissions to a new partition on the same server

Posted on 2006-05-26
Last Modified: 2011-09-20
I have Windows 2000 server that has a 60gb file share that needs to be moved to a new larger partition on the same server.  I'm looking for opinions on what the best tool would be to copy this data to the new partition while keeping the file permissions intact.  If XCOPY is the answer can you provide me with the syntax including appropriate switches to do this copy (including the switch to keep going if it encounters a file it cannot copy etc...)?

Will the modifiec/accessed date change of all the files/folders change if using XCOPY?  I've briefly looked into Scriptlogic's SecureCopy but don't think it's worth the $1000 for this one time data move.

Question by:knutsonit
    LVL 6

    Expert Comment

    Two gtages

    Assumed D: - Source
                  E: - Target

    1. Mark all files as Archive bit on
    ATTRIB +A d:\*.* /S
    +A - Set Archive bit for file to ON
    /S - Go through subdirectories.

    2. Copy files from source to target
    XCOPY d:\*.* e:\ /S/E/C/H/M/K/O
     /S           Copies directories and subdirectories except empty ones.
     /E           Copies directories and subdirectories, including empty ones.
                  Same as /S /E. May be used to modify /T.
     /V           Verifies each new file.
     /C           Continues copying even if errors occur.
     /Q           Does not display file names while copying.
     /H           Copies hidden and system files also.
     /K           Copies attributes. Normal Xcopy will reset read-only attributes.
     /O           Copies file ownership and ACL information.
     /X           Copies file audit settings (implies /O).

    If power fails or copy stops, run step 2 again.
    LVL 2

    Expert Comment

    I would use robocopy, this has a switch for maintaining permissions and can continue even if it encounters a problem (should you want it to)

    Author Comment

    Assume I want to only a directory (and everything in it) called D:\Projects to a new partition E:; would I need to first create a directory called "Projects" on E: for the destination placeholder? or is there a way using xcopy to have the copy job create the "Projects" directory.  The "projects" directory is the parent directory that many of the child directories have permissions progated to them.  I hope I'm making sense.  

    Also what purpose does turning the archive bit on for all of the files have in the example?

    Thanks again.
    LVL 6

    Expert Comment

    Better create the directory.
     use full path to make sure you know what is been copied.
    XCOPY d:\Projects\*.* e:\Projects\ /S/E/C/H/M/K/O
    LVL 6

    Expert Comment

    After the file has been copied, xcopy turns the archive bit off (the /M) and if in some situation the copy stops, you can continue since /M copies only Archive bit on.
    LVL 6

    Expert Comment

    Another thing about the Archive bit is that if somehow a file has changed while the copy takes place, when you run the xcopy the second time (you should, it collects changes in long copy), it will collect the files that change.
    The OS turns Archive bit on if the file has changed (saved again).

    Author Comment

    Is there a logfile created to see which files may not have copied over correctly?
    LVL 9

    Expert Comment

    Have a look at

    Its evaluation version should get you on your way.
    Yo can either create the target directory yourself and set the permissions to flow down over then start the transfer of data across from the source.
    Or you can just tell Vice Versa to create the target folder exactly the same as the source folder and leave it to it.
    Nice GUI interface.
    LVL 6

    Accepted Solution

    You will have a log file if you run:
    XCOPY d:\Projects\*.* e:\Projects\ /S/E/C/H/M/K/O >> c:\copylog.txt
    LVL 6

    Expert Comment

    Like chris_bol says you can use ROBOCOPY, it can copy or move and have log to file.

    ROBOCOPY source_folder destination_folder /S /COPYALL /MOVE /LOG:MyLogfile.txt

    "/COPYALL" is the copyflags to copy Data, Attributes, Timestamps, NTFS_Security_ACLs, Owner info and aUditing info.

    Tou can read on ROBOCOPY here

    You can find the old verion here
    but you can download XP's Admin Pack here

    The NT 4 and Windows 2000 resource kits include Robocopy 1.95 but I recommend you download the XP version
    which fixes a number of bugs - it runs fine on NT/2K

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    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…
    If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    779 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

    16 Experts available now in Live!

    Get 1:1 Help Now