iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Robocopy failures that look similar require different fixes. Error 5 (Access is denied) usually points to NTFS permissions, a network-share permission, or EFS encryption. Error 32 means another process is using the file, while Error 33 means another process has locked part of it. Robocopy’s /B and /ZB switches can address certain permission barriers, but they cannot unlock a file that an application still has open. Start with the complete error line and path, then apply the matching remedy below.
Identify which failure you actually have
Read the error number, wording, and full path in the Robocopy output before changing switches. The failed operation may be reading the source file, creating or replacing the destination file, or copying metadata and permissions. Those are separate access checks.
| Robocopy symptom | Windows meaning | Likely scope | Correct first response |
|---|---|---|---|
| ERROR 5 (0x00000005): Access is denied | The account lacks an access right required by the operation, or another security control prevents access. | Source or destination NTFS ACLs, SMB share permissions, elevated-rights requirements, or encryption. | Check both sides’ permissions and the identity being used. For an authorized backup, run an elevated console and test /B or /ZB. |
| ERROR 32 (0x00000020) “The process cannot access the file because it is being used by another process.” |
ERROR_SHARING_VIOLATION: another process has the file open in a way that conflicts with the copy. |
Usually a local application, service, user session, or a program on the file server. | Find the process using the named file, arrange for it to close or release the file, then retry. |
| ERROR 33 (0x00000021) | ERROR_LOCK_VIOLATION: another process has locked a portion of the file. |
Applications that use byte-range or partial-file locks. | Use the same open-file investigation, but expect that closing the application or waiting for its transaction is required. |
| Access remains denied even though ACLs look correct | EFS can restrict access independently of ordinary NTFS permissions. | An encrypted file and the user or recovery agent associated with its certificate. | Use the encrypting identity or designated recovery agent; changing ACLs alone is not a fix. |
Microsoft’s Win32 error-code reference defines codes 32 and 33. Robocopy’s command documentation covers the switch behavior and return codes for supported Windows Server 2016–2025, Windows 10/11, and listed Azure Local versions in Microsoft Learn.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchFix “Access is denied” (error 5)
1. Establish which access check failed
Use the path printed beside the error to determine whether Robocopy could not read the source, could not create or replace the destination item, or failed while copying timestamps, ownership, auditing data, or other security metadata. Check the account running Robocopy on the source and destination. A successful login to a computer does not automatically grant the rights needed for every folder or file.
#1 Best Overall
- Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
For a network path, evaluate both layers of authorization: the SMB share permission and the NTFS file-system permission. The effective result is constrained by the more restrictive layer. Also confirm that the command is using the intended account; a mapped drive created in one sign-in session may not represent the same credentials used by an elevated console or scheduled task.
2. Run an elevated console when backup mode is authorized
Robocopy’s /B switch means “backup mode.” In that mode, Robocopy overrides file and folder ACL settings that might otherwise block access. This is an access method for an account that has the required backup privilege; it is not a way to obtain permission that the account or share administrator has not granted.
Open Command Prompt or PowerShell with Run as administrator, then run the command with /B only when the operation is an authorized backup or migration. Microsoft’s Azure Files migration guidance specifically requires an elevated console or PowerShell window for this mode: Migrate to Azure Files Using RoboCopy.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →3. Use /ZB when restartability is also needed
/ZB starts in restartable mode and switches to backup mode if access is denied. Restartable mode is useful when a copy may be interrupted and resumed; the backup fallback addresses an ACL barrier when the account is entitled to use it. It does not change a sharing violation into a successful copy. If the destination file is open, /ZB still cannot write through a conflicting handle.
4. Check share credentials and Azure Files-specific access
On an SMB or Azure Files path, verify that the share is mounted with credentials that have the required permissions. In the Azure Files migration scenario, Microsoft calls out using a storage-account access key to mount the share as part of its described procedure. That requirement is specific to that migration setup; it is not a universal replacement for correctly configured identity-based access.
Rank #2
- Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Neither /B nor /ZB bypasses every remote-share security control. A server can deny the connection, the share can impose a restriction, or the account can lack the privilege needed for backup mode. Correct the account, share, or server configuration rather than repeatedly adding switches.
5. Investigate EFS when normal permissions appear correct
Encrypting File System (EFS) is separate from ordinary NTFS ACL evaluation. Microsoft’s support guidance explains that an EFS-encrypted file is accessible only to the user who encrypted it or to a designated recovery agent, even when another account appears to have adequate file permissions. See Access denied error message appears when permissions are correct.
The remedy is to run the operation under the authorized encryption identity or recovery path, or to decrypt the file through an approved process. Broadening ACLs, taking ownership, or adding /B does not supply the missing EFS certificate.
Fix a file-in-use error (errors 32 and 33)
1. Treat the message as a lock problem, not a permissions problem
Error 32’s exact Windows wording is: “The process cannot access the file because it is being used by another process.” Error 33 means that another process has locked a portion of the file. Both indicate an active handle or lock conflict. Changing ACLs, elevating the console, and adding backup mode do not release that handle.
2. Locate the exact file and the process holding it
Use the failed path in the Robocopy log to identify the file, then determine which application, service, or user session is using it. The process may be on the computer running Robocopy, on a server hosting the share, or in a remote session. Investigate the file named in the error rather than assuming that every item in the directory is blocked.
Rank #3
- Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
3. Close or quiesce the workload safely
If operationally safe, have the application save its work and close the file, stop the related service during a maintenance window, or otherwise arrange for it to release the handle. Do not terminate a process blindly: databases, virtual-machine disks, mail stores, and other stateful files can be corrupted when their writer is stopped without application-level coordination.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →4. Retry deliberately
After the file is released, rerun Robocopy for the affected tree or a narrower source and destination. Set an explicit retry count and wait interval instead of allowing a blocked file to monopolize the job. /R:n sets the number of retries and /W:n sets the wait in seconds between retries. For example, /R:3 /W:5 makes three additional attempts with five seconds between attempts.
If a file is expected to remain open during business hours, schedule a later pass. Microsoft’s Azure Files migration guidance notes that applications can hold files open for hours and that planned subsequent Robocopy runs can eventually copy files that remain unresolved in an earlier pass.
A safe baseline command and how to verify it
Use a non-mirroring command while diagnosing. Replace the example paths with locations for which you are authorized to copy:
robocopy "C:Source" "D:Destination" /E /R:3 /W:5 /LOG:"C:Logsrobocopy.log"
/Eincludes subdirectories, including empty ones./R:3bounds retries at three attempts./W:5waits five seconds between retries./LOG:writes a persistent log for finding the exact failed path and reviewing the final summary.
When the evidence points to an ACL barrier and the account is entitled to backup-mode access, add /B or use /ZB if restartability is required. Do not add either switch merely because a file is in use.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsRank #4
- Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Preview before changing a destination
Add /L for a list-only run when you need to see what Robocopy would copy without actually copying it. This is useful for validating source and destination paths, exclusions, and the set of files that will be considered before a production run.
Read the log and return code
Review the individual error lines and the final summary in the log. Robocopy return codes from 0 through 7 can represent successful copies, differences, or extra files in the destination without a copy failure. A return code of 8 or higher means that at least one failure occurred. Treat the process as unsuccessful until you identify and resolve those failed items, even if most files copied correctly.
Robocopy’s official switch and return-code definitions are maintained at robocopy.
When a later pass is better than forcing the first one
A migration or file-server copy often has two different populations: files that are stable now and files that are actively written. Copy the stable set, record the failures, and run a bounded follow-up after the users or applications release the remaining files. This approach avoids unsafe process termination and gives you a measurable list to reconcile.
For Azure Files migrations, Microsoft explicitly describes open files as a reason a migration may not finish in one pass and recommends planned subsequent runs. The same operational principle applies to ordinary Windows file-share moves: use the log to drive the next pass rather than repeatedly hammering a file with unbounded retries.
Best Value
- [Upgraded Version] - This external hard drive features a mirrored logo stripe combined with a striped anti-slip design, and the rounded corners of the casing make it easier to grip. The stripes also have a heat dissipation function, ensuring stable and fast data transfer.
- 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
- 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
- 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
- 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.
Robocopy backup mode is not a snapshot
/B and /ZB control how Robocopy accesses files and resumes transfers. They do not create a point-in-time image and do not coordinate an application’s writes. A file can change between the time Robocopy reads one part and the time it reads another, or remain locked throughout the copy.
For a consistent backup of active application data, use a workflow that coordinates with the application and Windows Volume Shadow Copy Service (VSS). VSS coordinates a backup requester, application or service writers, and a storage provider so a volume backup can be taken while applications continue writing. It is a separate Windows framework, not a hidden feature enabled by adding /B to a Robocopy command. Microsoft’s overview is available at Volume Shadow Copy Service (VSS).
Choose the method according to the required consistency:
| Requirement | Appropriate approach | What it does not guarantee |
|---|---|---|
| Best-effort copy of ordinary, mostly idle files | Robocopy with bounded retries, logging, and a later pass for failures. | It does not guarantee a transactionally consistent application dataset. |
| Copy blocked by ACLs during an authorized backup | Elevated Robocopy with /B, or /ZB when restartable behavior is wanted. |
It does not unlock a file, defeat EFS encryption, or override every remote-share policy. |
| Consistent backup while applications write | A VSS-aware, application-coordinated backup workflow. | VSS is not implemented by Robocopy’s backup-mode switches alone. |
Troubleshooting flow by symptom
- Capture the full line. Record the error number, wording, source or destination path, and whether the command was local or through a share.
- Classify the failure. Error 5 is an access-control or encryption investigation; errors 32 and 33 are open-file or lock investigations.
- Check both endpoints. For error 5, verify the running account, NTFS rights, share rights, and whether the operation needs elevated privileges.
- Test the authorized access method. In an elevated console, use
/Bfor backup mode or/ZBfor restartable mode with backup fallback. For EFS, switch to the encrypting user or recovery agent instead. - Release or schedule around open files. For errors 32 and 33, identify the owning process and retry after it safely releases the file.
- Bound and document the run. Set
/R:n,/W:n, and/LOG:; use/Lfirst when validating a potentially risky command. - Interpret completion correctly. Inspect the log and return code. Code 8 or higher requires attention to failed items.
Common mistakes that prolong the problem
- Using
/Bfor a lock violation: backup mode changes ACL handling, not another process’s open handle. - Changing ACLs when EFS is involved: EFS access depends on the encryption certificate and authorized identity.
- Checking only NTFS permissions on a share: SMB share permissions and file-system permissions both matter.
- Leaving retries unbounded: a single perpetually open file can delay the rest of the job; choose explicit
/Rand/Wvalues. - Assuming a low return code means every file copied: codes 0–7 can include differences or extra destination files; inspect the log for the actual outcome.
- Starting with a mirror or purge command: destructive destination changes are unnecessary for diagnosis. Validate with
/Land a non-mirroring command first. - Stopping a writer without a recovery plan: forcibly ending an application that owns a file can damage its data; schedule a controlled outage or use an application-aware backup workflow.
What to record for an escalation
If the issue persists, provide the administrator or application owner with the exact Robocopy command (redacting secrets), the complete error line, the source and destination type (local disk, SMB share, or Azure Files), the account context, the timestamp, and the relevant log excerpt. Include whether an elevated console was used, whether /B or /ZB was tried, the retry settings, and the final return code. This information distinguishes a missing privilege from an active lock without requiring repeated guesswork.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

