Pcornel
Browse topics
Options
Recent
Favorites
Windows · Technical reference

File Operations Troubleshooting

Direct answer

Troubleshoot file operations by checking permissions and ownership, files locked by another process (Resource Monitor, handle.exe), path length, read-only or system attributes, free space and antivirus blocking.

When to use this

Use this when file copy, move or delete operations fail.

First 30 seconds

1. Exact error (Access denied, in use, path too long, not found).

2. Access denied → Get-Acl, ownership.

3. In use → handle.exe <file> / Resource Monitor.

4. Path too long → long paths / robocopy.

5. Network path → connectivity and share permissions.

Operational verification

operation → path resolution → lock check → ACL check → result

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Microsoft Windows
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformMicrosoft Windows
Scope / prerequisiteUse this when file copy, move or delete operations fail.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Known-good, broken and when it is fixed Verify boundary

Known-good means the same identity can read the source, create/replace the destination and read back expected size/hash/metadata without new filesystem or storage errors. Broken evidence is a reproducible authorization, lock, path or I/O failure tied to one boundary. A successful small test file shows only that operation/path; the limit of what it shows for the incident is the original file set and destination under the original identity, with integrity read-back where data correctness matters.

Step 2 Common mistakes Narrow the fault
  • Copying with Explorer instead of robocopy for large or ACL-sensitive copies.
Step 3 Native failure isolation and next-check logic Narrow the fault

Test source read and destination create separately using the same user context. For Access Denied, inspect effective ACL/share rights and ownership rather than taking ownership immediately; for sharing violations, identify the open handle/process; for path/name problems, test the exact API/path form; for I/O errors or stalls, correlate filesystem/storage events and another file on the same volume. If local copy works but SMB copy fails, branch to SMB/share/network rather than filesystem repair.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • 'Access denied' is often ownership or broken inheritance.
  • 'File in use' means another process holds a handle.
  • Path length over 260 characters breaks some tools.
Key checks
  • Get-ChildItem <path> -Force — contents including hidden
  • Test-Path <path> — exists?
  • Resolve-Path <path> — full path
  • Get-Item <path> | fl * — attributes and timestamps
ReferenceHow it works1 section · depth on demand

How it works

Windows file operations are mediated by path resolution, share/NTFS authorization, filesystem metadata, open handles/locks, filter drivers and underlying storage completion. A copy may fail because the source cannot be read, destination cannot be created, a file is in use, a path exceeds application limits, security blocks the operation or the volume cannot commit data. Explorer messages often collapse these boundaries, so preserve the exact source/destination, identity and Win32/PowerShell error.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Copy with logging you can trust

robocopy D:\Data \\fs02\Data /MIR /COPY:DAT /DCOPY:DAT /R:2 /W:5 /MT:16 /XJ /NP /LOG:C:\Temp\copy.log /TEE
echo %ERRORLEVEL%
OptionEffect
/MIRMirror — deletes files at the destination that are not in the source
/COPY:DATSOUData, attributes, timestamps, security (ACLs), owner, auditing
/R:2 /W:52 retries, 5 s wait (default is 1 million retries × 30 s)
/MT:1616 threads
/XJSkip junctions (avoids loops in profile folders)
/B or /ZBBackup mode — copy files despite ACLs (needs backup privilege)
/LList only — dry run

Exit codes

The robocopy reference documents its exit codes and states that any value of 8 or more means at least one failure. Practical summary:

CodeMeaning
0Nothing copied, no failure
1Files copied successfully
2Extra files at destination
3Copied + extra files
5 / 6 / 7Combinations including mismatched files
≥ 8At least one file failed

Scripts that treat any non-zero exit as failure break on robocopy; test %ERRORLEVEL% GEQ 8.

Common file-operation errors

ErrorCauseFix
Access deniedACL, file owned by another user, or EFSBackup mode /B, take ownership deliberately
The process cannot access the file because it is being usedOpen handleGet-SmbOpenFile on servers, Resource Monitor / handle.exe locally
Path too long> 260 characters for apps without long-path supportRobocopy handles long paths; enable LongPathsEnabled for supporting apps
File name invalidTrailing spaces/dots, reserved names (CON, NUL)Rename via \\?\ prefix paths
Disk full at destinationSpace, quotas (FSRM)Check quota and free space

Verify the copy

Compare counts and sizes from the log summary; for critical data, compare hashes (Get-FileHash) on a sample.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Method

File operation troubleshooting covers copy, move and delete failures: access denied, file in use, path too long, or slow transfers.

ErrorCauseFix
Access deniedPermissions, ownership, UACCheck ACL; take ownership carefully (takeown, icacls)
File in useOpen handleFind with Resource Monitor or handle.exe; close the application
Path too long> 260 charactersEnable long paths (policy), use \\?\ prefix or robocopy
Disk full / quotaFree space, user quotaGet-Volume, FSRM quotas
Slow copiesAntivirus, small files, networkrobocopy with /MT, exclusions where appropriate
icacls "D:\Data\file.txt"
handle64.exe -a budget.xlsx
robocopy D:\Src E:\Dst /E /COPY:DAT /R:2 /W:5 /MT:16 /LOG:C:\Temp\copy.log
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docMicrosoft Windows current

Authoritative/upstream documentation reviewed for bounded claims in Files & Directories → File Operations Troubleshooting. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/windows-server/storage/file-server/ntfs-overview · confidence 94%
Confirmation

Confirm action

Continue?