Robocopy ERROR 32 means Windows refused to open a file because another program already has it open in a way that does not allow sharing, so Robocopy cannot read or replace it. With default settings Robocopy then retries that file every 30 seconds up to a million times, which is why a copy can appear to hang. The fix is to find and close the program holding the file, or skip it with sensible retry settings; LockGhost from Automata Labs shows which process is locking a file on Windows.
See exactly which app or service is holding a file open, with friendly names instead of process IDs.
Get it fromMicrosoft
What does Robocopy ERROR 32 mean?
The number comes from Windows itself. Microsoft’s list of system error codes defines ERROR_SHARING_VIOLATION as 32 (0x20): “The process cannot access the file because it is being used by another process.”
Robocopy reports it on the file it was trying to copy, along with the hexadecimal code and Microsoft’s message. Either the source file is open in a program that does not let others read it, or the destination file is open and cannot be overwritten.
A close relative is error 33 (0x21), ERROR_LOCK_VIOLATION: “The process cannot access the file because another process has locked a portion of the file.” We cover that one in error 0x80070021 explained.
| Code | Name | What it means |
|---|---|---|
| 32 (0x20) | ERROR_SHARING_VIOLATION | The whole file is open without sharing |
| 33 (0x21) | ERROR_LOCK_VIOLATION | Part of the file is locked by another process |
| 5 (0x5) | ERROR_ACCESS_DENIED | A permissions problem, not a lock |
Why does Robocopy seem stuck on ERROR 32?
Because of its defaults. Microsoft’s robocopy documentation says /r “specifies the number of retries on failed copies. The default value of n is 1,000,000 (one million retries),” and /w “specifies the wait time between retries, in seconds. The default value of n is 30.”
A million retries at 30 seconds each adds up to about 347 days. In practice, a file held open by a program that stays running means Robocopy keeps waiting and retrying on that one file, and in a normal run the rest of the job waits behind it.
How do I make Robocopy skip locked files?
Set the retry count and wait time yourself. For example, /r:2 /w:5 tries a failing file twice more, five seconds apart, then moves on and logs it as a failure. Choose values to suit the job:
| Situation | Suggested retry settings | Why |
|---|---|---|
| Interactive copy you are watching | /r:1 /w:1 | Fail fast and fix the lock yourself |
| Scheduled overnight backup | /r:3 /w:10 | Give briefly busy files a chance |
| Files that are only open for moments | /r:5 /w:5 | Wait out short saves |
| Default behavior | /r:1000000 /w:30 | Rarely what anyone wants |
Microsoft also documents /reg, which “saves the values specified in the /r and /w options as default settings in the registry,” if you want new defaults for every run on that machine.
Skipping only helps if you notice what was skipped. Add a log with /log: (or /log+: to append), use /tee to see output on screen as well, and consider /np to leave out progress percentages so the log stays readable. Then check the exit code: Microsoft says “any value equal to or greater than 8 indicates that there was at least one failure during the copy operation.”
Does Robocopy /b or /zb fix ERROR 32?
No, and this is a common mix-up. Microsoft explains that in backup mode, /b, “robocopy overrides file and folder permission settings (ACLs), which might otherwise block access.” That solves access denied errors, which are about permissions. A sharing violation is about another program having the file open, which is a different problem. /zb uses restartable mode and “if file access is denied, switches to backup mode,” which again targets permissions.
| Option | What it is for | Fixes ERROR 32? |
|---|---|---|
/b | Copying past permission settings | No |
/zb | Restartable mode, falling back to backup mode on access denied | No |
/r: and /w: | Retrying and skipping failed files | Lets the job continue |
| Closing the program | Releasing the file | Yes |
Why can’t Robocopy copy files that are open?
Windows lets the program that opens a file decide whether others may read or write it at the same time. Databases, mail stores, virtual machine disks and some sync tools keep files open exclusively while they run. Microsoft’s Volume Shadow Copy Service overview describes the core problem for backups: data “usually needs to be backed up while the applications that produce the data are still running,” so “some of the data files might be open or they might be in an inconsistent state.” That is why backup software built on shadow copies exists. Robocopy copies the live file system, so for files that stay open, either close the program for the copy or use backup software designed for open files.
How do I find which process is locking the file?
Take the path from the Robocopy log, then identify what has it open. Windows gives you a few built-in routes, covered in our guide to finding which process is locking a file, such as Resource Monitor’s handle search.
LockGhost is a file unlocker for Windows built for exactly this. According to its Microsoft Store listing, it offers:
- File and folder lock detection to identify the process behind “file in use,” “access denied” and “cannot delete file” errors.
- Friendly process details that “replace obscure process IDs with understandable app names and clear lock information.”
- Guardrails to help you avoid ending critical system processes.
- An Explorer-friendly workflow for resolving locks from your normal file management routine.
- Local lock history so you can review recent lock events.
- Offline privacy, with no cloud account and no telemetry.
Find the process behind a failed copy, then decide calmly whether to close it.
Get it fromMicrosoft
Once you know the program, close it normally, wait for the job to finish, or schedule the copy for a time when it is not running. Ending a process should be the last option, especially for services. Our guide to safely ending a process that is locking a file explains what to check first, and the file is being used by another process (error 32) covers the same error outside Robocopy.
A Robocopy ERROR 32 checklist
- Note the file path and whether it is the source or the destination.
- Stop the endless retry with sensible
/r:and/w:values. - Add
/log:and/teeso every failure is recorded. - Find the locking process and close it, or schedule around it.
- Rerun the job, which copies only what is missing or changed by default.
- Check the exit code; 8 or more means something still failed.
Frequently asked questions
Is Robocopy ERROR 32 a permissions problem?
No. It is a sharing violation, meaning another program has the file open. Permission problems usually show as error 5, access denied.
Why does my Robocopy job never finish?
With defaults of a million retries and 30 seconds between them, a permanently locked file keeps the job waiting. Set /r: and /w: explicitly.
Can Robocopy copy a file that is open?
Only if the program that opened it allows others to read it. Otherwise, close the program or use backup software designed for open files.
Will /mt make ERROR 32 go away?
No. Multithreading changes how many files copy at once, not whether a locked file can be opened.
What exit code means Robocopy failed?
Microsoft says any value of 8 or higher indicates at least one failure.
Try LockGhost
Get LockGhost from the Microsoft Store. It is a one-time purchase with no subscription, and the Store listing shows the current price.
Stop guessing which app holds your files and fix file-in-use errors from Explorer.
Get it fromMicrosoft
Microsoft, Windows and Windows Server are trademarks of the Microsoft group of companies. LockGhost is not affiliated with or endorsed by Microsoft.
Last updated 24 October 2026. Published by Automata Labs, a software company in Canada.