Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
FREEDOM251

Freedom251 › Blog › Backup

Robocopy Access Denied or File-in-Use Errors: Causes and Fixes

By Freedom251 Team · · 10 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Robocopy errors that look similar need different fixes. ERROR 5 (Access is denied) usually points to NTFS or share permissions, an operation that needs elevation, 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 overcome some permission barriers when used by an authorized, elevated account, but they cannot unlock a file that an application has open. Diagnose the exact error and path first, then choose a permissions, encryption, retry, or application-coordinated backup solution.

Start with the exact error line and path

Do not treat every Robocopy failure as an access-control problem. Copy the complete error line from the console or log, including the source and destination paths. The failing side matters: Robocopy might be unable to read the source, create or replace the destination file, or apply timestamps, attributes, ownership, or ACLs.

As an Amazon Associate I earn from qualifying purchases.

Microsoft’s Win32 reference defines sharing violation 32 as: “The process cannot access the file because it is being used by another process.” Error 33 is a lock violation: another process has locked a portion of the file. Those are different from error 5, “Access is denied.” A Microsoft Q&A example shows the same file-in-use wording when a destination file is open: ROBOCOPY skip file if DESTINATION is in use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Robocopy result What it means First response
ERROR 5 (0x00000005)
Access is denied
The account cannot perform the requested read, write, metadata, or security operation, or an encrypted file cannot be opened by that identity. Check source and destination permissions, share permissions, elevation, and EFS status. For an authorized backup, test /B or /ZB.
ERROR 32 (0x00000020)
Sharing violation
Another process is using the file with sharing settings that prevent Robocopy’s requested access. Find the process, close or quiesce the application when possible, and retry with bounded values for /R and /W.
ERROR 33 (0x00000021)
Lock violation
Another process has locked part of the file. Investigate the application or service holding the lock. A permissions switch will not remove a live byte-range lock.

A network path adds another layer. Access must be allowed by the account, the SMB share, and the target file system. A user can have NTFS rights and still be refused by the share, or connect to the share with credentials different from the interactive sign-in.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Why Robocopy reports access denied

NTFS permissions and the operation being attempted

Robocopy needs permission for the specific action, not merely permission to list a folder. Reading file data, creating a destination file, replacing an existing file, preserving timestamps, and copying security descriptors can require different rights. First determine whether the denied path is on the source or destination and whether the error occurs during data copying or metadata processing.

Check the effective permissions of the account that actually runs Robocopy. A scheduled task, service account, elevated administrator, and ordinary desktop session can all have different tokens. On a share, check both the share-level permission and the underlying NTFS ACL; the more restrictive result applies.

Use backup mode only for an authorized backup

Microsoft documents /B as backup mode: “Copies files in backup mode. In backup mode, robocopy overrides file and folder permission settings (ACLs), which might otherwise block access.” See the current Robocopy command documentation. Backup mode relies on Windows backup privileges, so run it from an elevated Command Prompt or PowerShell window. Microsoft also calls out elevation for Robocopy in its Azure Files migration guidance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

/ZB combines two behaviors: Robocopy starts in restartable mode and switches to backup mode if access is denied. Use it when restartability is useful and the account is authorized for backup access. Neither switch grants arbitrary access to a remote share, defeats authentication, or makes an account entitled to data it is not permitted to handle. Confirm that the share credentials and organizational policy allow the operation.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
robocopy "C:Source" "D:Destination" /E /ZB /R:3 /W:5 /LOG:"C:Logsrobocopy.log"

The example uses a non-mirroring copy, three retries, a five-second wait, and a log. Replace the paths and values with ones approved for your environment. If you are troubleshooting a normal user copy rather than an authorized backup, fix the account or ACL instead of adding /B as a workaround.

Share-level access and Azure Files

For an SMB or Azure Files destination, verify how the share was mounted and which identity the connection uses. Microsoft’s migration procedure describes mounting the Azure file share with a storage-account access key in that scenario; it also requires an elevated console for backup-mode Robocopy. Do not generalize that credential method to every deployment: use the authentication model configured for your share and protect any key as a secret.

A share can also reject an operation because the destination account lacks create, modify, or delete rights even though the source is readable. Test a small, authorized file operation on the same path before launching a large copy, and ensure that the destination folder exists and is writable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

EFS can override otherwise-correct ACLs

Encrypting File System (EFS) is an identity restriction, not just an ACL entry. Microsoft explains in its EFS access-denied guidance that an encrypted file is accessible to the user who encrypted it or to a designated recovery agent, even when ordinary permissions appear correct. If Robocopy reports error 5 on an EFS file, identify the encrypting identity or recovery-agent path. Broadening NTFS permissions or adding /B is not a substitute for authorized EFS access.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord | 6.35mm Jack, Durable Design, Stage and Home Studio Use, Low Noise Shielded Electric Cord for Bass, Keyboard, Amp, Mixer
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Fixing a file-in-use, sharing, or lock violation

Locate the exact file and the process holding it

Use the path printed in the Robocopy log as the starting point. Determine whether the handle is on the source or destination computer. Check which application, service, indexer, antivirus component, database, or user session has the file open, using the administrative open-file or handle-inspection tools approved for your Windows environment. The goal is to identify the owner of the handle, not to terminate an unrelated process.

If the file belongs to an application, use that application’s save, close, export, or maintenance procedure. For a service, follow its documented stop or quiesce procedure and account for dependencies. Do not forcibly terminate a process or delete a locked file simply to make a copy succeed; that can corrupt the application data.

Retry deliberately instead of waiting indefinitely

/R:n sets the number of retries and /W:n sets the wait between retries. A bounded policy makes a migration or scheduled job predictable and leaves an auditable list of files that need attention.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
robocopy "C:Source" "D:Destination" /E /R:3 /W:5 /LOG:"C:Logsrobocopy.log"

Three five-second retries are only an example. Choose values based on how long the application normally holds a file. A short retry window is useful for transient opens; a long-running database export may need a maintenance window instead. Review the log after the run rather than assuming that a retry eventually succeeded.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Plan a later pass for files that remain open

Microsoft’s Azure Files migration guidance notes that applications can hold files open for hours and recommends planned subsequent Robocopy runs to catch files that could not be copied earlier. This is a practical migration pattern: complete the bulk copy, record unresolved paths, coordinate a quiet period, and run the same source-to-destination copy again. A later pass is not the same as silently ignoring failures; keep the logs and verify that the outstanding list shrinks.

Why /B does not unlock a live file

Backup mode changes how Robocopy obtains access when ACLs block it. A sharing violation or lock violation is enforced by the process that opened the file and by the sharing mode it requested. Changing Robocopy’s privilege does not cancel that handle. Close or quiesce the application, use a workflow designed for active data, or accept that the file must be copied in a later pass.

When you need a consistent backup of active data

Robocopy is a file-copy utility; it does not automatically create an application-consistent point-in-time image. Windows Volume Shadow Copy Service (VSS) is a separate framework that coordinates a backup requester, application or service writers, and a storage provider so a volume can be captured while applications continue running.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Adding /B or /ZB to a normal Robocopy command does not invoke VSS and does not make a set of database files transactionally consistent. If the requirement is a recoverable backup of an active database, virtual machine, mail store, or other coordinated application, use a backup workflow that supports that application’s writer and VSS where appropriate. Use plain Robocopy for best-effort file replication or for data that can be quiesced safely.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Build a safe Robocopy run and inspect what it did

Start with a non-destructive, logged command

robocopy "C:Source" "D:Destination" /E /R:3 /W:5 /LOG:"C:Logsrobocopy.log"
  • /E copies subdirectories, including empty ones.
  • /R:3 and /W:5 bound the retry behavior.
  • /LOG: writes a persistent record for review and later comparison.

When evaluating a new path or filter, add /L for list-only mode. It shows what Robocopy would copy without performing the copy, which is useful for checking spelling, exclusions, and scope. Remove /L only after the preview matches the intended operation.

Be cautious with mirror and purge options

A troubleshooting run should not introduce an unrelated deletion problem. Mirror or purge options can remove items from the destination that are not present in the source. Preview any destructive command with /L, confirm the source and destination are in the correct order, and keep a log. Use the simple /E pattern while diagnosing access or lock failures unless synchronization with deletion is an explicit requirement.

Interpret the return code, not just the last screen line

Robocopy’s final return value is a bit field describing the outcome. Microsoft documents that a code of 8 or greater means at least one failure occurred. Codes below 8 can still report differences or extra destination files without a copy failure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Return code Meaning in practical terms
0 No files needed copying and no differences were reported.
1 One or more files copied successfully.
2 Extra files or directories were found at the destination.
3 Files copied and extra destination items were found.
4 Mismatched files or directories were detected.
5–7 Combinations of copied items, mismatches, and extra destination items; no failure bit is set.
8 or higher At least one file or directory failed to copy.

Search the log for the failed path and its associated error before treating a code below 8 as proof that every desired file is identical. Conversely, a code of 8 or higher requires investigation even if most files copied successfully.

Scenario-specific playbooks

Local disk to local disk: error 5

  1. Record the exact source or destination path and whether the failure happens during data or metadata copying.
  2. Confirm that the signed-in account can browse the source and create a test file in the destination.
  3. Open an elevated console only when your account is authorized to perform the backup operation.
  4. Retry with /B for an ACL-related backup denial, or /ZB when restartable behavior is also needed.
  5. If the file is EFS-encrypted, use the encrypting user or designated recovery agent instead of changing unrelated ACLs.
  6. Run again with a log and inspect the return code and failed paths.

SMB share to another share: error 5

  1. Check the identity used for each network connection; an interactive user and a scheduled task may not use the same credentials.
  2. Verify share-level and NTFS permissions on both ends, including the rights to create, replace, and read files.
  3. Test a small authorized copy to distinguish authentication or share configuration from a single problematic file.
  4. Use elevated /B or /ZB only when the remote environment supports the required backup privileges; these switches do not bypass share authentication.

File server migration: errors 32 or 33

  1. Run the bulk copy with a log and bounded retries.
  2. Export or record the files that still fail with sharing or lock violations.
  3. Coordinate a maintenance or user-quiet period and ask applications to close files cleanly.
  4. Run a later pass, preserving both logs so you can prove which paths were eventually copied.
  5. If the data must remain writable and consistent during capture, move to a VSS- and application-aware backup workflow rather than relying on Robocopy switches.

EFS-protected source

  1. Confirm that the failing path is encrypted and identify the encrypting user or recovery agent.
  2. Run the copy under that authorized identity or use the organization’s approved recovery procedure.
  3. Do not assume that administrator membership, a changed ACL, or /B grants EFS decryption access.
  4. Document how encrypted data will be protected at the destination and test recovery before deleting the source.

Common mistakes that prolong the problem

  • Using /B for every failure: It addresses certain ACL barriers, not sharing or byte-range locks.
  • Ignoring the destination: A destination file opened by a user or service produces the same type of sharing violation as an open source file.
  • Leaving retries unbounded: A single permanently open file can keep a job running far longer than expected.
  • Changing ACLs before checking EFS: EFS identity rules can remain the real barrier even when permissions look generous.
  • Assuming a successful majority means a complete copy: Inspect failed lines and the final return code; one missed database or configuration file may matter more than thousands of successful files.
  • Using mirror or purge options during diagnosis: A path-order mistake can delete destination data while you are trying to solve an access error.
  • Calling Robocopy a snapshot: A normal copy can observe files at different moments. Application-consistent capture requires coordination such as VSS.

A concise decision checklist

  1. Copy the full error, numeric code, and failing path from the log.
  2. If the code is 32 or 33, identify the process or service holding the file; do not start by changing ACLs.
  3. If the code is 5, determine whether source read, destination write, metadata, share access, or EFS identity is the blocker.
  4. For an authorized ACL-related backup, use an elevated console with /B or /ZB; verify the account and share configuration first.
  5. Set explicit /R:n and /W:n values, log the run, and schedule a later pass for files that remain open.
  6. Use /L before any broad or destructive command, and avoid mirror or purge switches until the scope is proven.
  7. Review every failed path and treat return code 8 or higher as a failed run requiring remediation.
  8. If active application data must be consistent, use a VSS- and application-aware backup process instead of expecting Robocopy access switches to provide a snapshot.

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.

BackupEFSFile permissionsROBOCOPYSMBTroubleshootingWindows

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.