General discussion


How to script RoboCopy to omit ntuser files when copying user files?

By TinkRbelle ·
I all,

I have RoboCopy and use a specific script to copy data files to my external backup drive. But, I also want to back up my User folder files as well. The problem I am having is that when it comes to the ntuser.dat, ntuser.DAT and ntuser.ini files it will hang and not go any further, as these files will not copy. Is there a way that I can adjust copy script to ignore these any ntuser files so that it won't hang up the backup?

The current script that I am using is listed below, with the necessary changes in the user and file names, but, I think that most can still get the gist of the script function. Please note that the script wrap.
robocopy c:\\Users\username\Documents g:\\usernameDocs /MIR /V /TEE /LOG:"e<foldername>\Backup usernameDocs\foldernameBelle64Backuplog.txt"

What might I add and where to have the process skip or ignore these ntuser files:

These are the files that I need to be able to bypass in the backup so that it will not kill the process. This script is running and works well until it gets to the above files and then it hangs.

Any suggestions, information or references would truly be very much appreciated. :-)

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Stopping robocopy from hanging on ntuser.dat files.

by plepkowski In reply to How to script RoboCopy to ...

You could use the exclude file switch like this: /XF ntuser.* ntuser.dat.*

Or you could stop the retries that hang robocopy with two switches like this: /R:1 /W:1

The script line might make more sense if you use a job file instead.

Related Discussions

Related Forums