Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Redmond desk6 min

How to Delete a File That Says “Unable to Delete” in Windows

A Windows file that will not delete can be in use, blocked by permissions, affected by OneDrive sync, or unreachable because of its path or name. Match the fix to the exact error before escalating.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

“Unable to delete” is a symptom, not a diagnosis. First confirm the exact file and location, then match the error to the likely cause: an app using the file, missing permissions, OneDrive activity, an overlong path, an unusual filename, or possible disk trouble. Start with low-risk steps and avoid force-delete commands until you know what is blocking the file.

Before troubleshooting, confirm the file and protect anything important

Check the complete filename and folder path, and confirm that you have selected the intended file. Note whether it is in a OneDrive folder, on a removable drive, or in a work- or school-managed location. If the file matters, verify that another copy exists or back it up before attempting permanent deletion or disk repair.

As an Amazon Associate I earn from qualifying purchases.

Write down the exact error message. Messages such as “The action can’t be completed because the folder or a file in it is open in another program,” “file is in use,” and “Access is denied” point toward different next steps. The first message can also be caused by an overlong path, so it does not prove that a visible app has the file open. Microsoft documents these and other NTFS deletion causes; its article is written for Windows Server, so treat it as a technical reference rather than a consumer-specific interface guide.

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

Try the low-risk steps first

  1. Close likely apps. Close the document, image editor, media player, or other program that may have opened the file. Save any work first. Check preview panes or other open windows that may be displaying it, then try deleting it again.
  2. Wait for an operation to finish. If the file is being copied, downloaded, or synchronized, let that operation complete before trying again.
  3. Restart Windows if the file still appears in use. A process can retain an open handle after an app window is closed. Save your work and restart, then try deleting the file before reopening the apps that might use it. Microsoft’s technical guidance is direct: “You can’t delete a file if the file is being used”; the process holding the open handle has to release it.

If these steps do not help, follow the branch that fits the error and location. A command that forcibly removes a file will not fix every underlying cause and can make it easier to delete the wrong target.

#1 Best Overall
Sale
Logitech M185 Compact Ambidextrous 2.4 GHz Wireless Mouse - Swift Grey | Ambidextrous mouse with 2.4 GHz USB-A Nano Receiver, Optical Tracking, 12-Months Battery Life, PC, Mac, Laptop compatible
  • Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
  • Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
  • Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
  • Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
  • Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)

If Windows says the file is in use

Close the program that is using the file and wait for any save, export, or transfer to finish. If you cannot identify the program, a restart is a safer first escalation than changing permissions or using a force-delete command. An open handle may remain until the process releases it.

If the error specifically involves OneDrive, use the OneDrive steps below: Microsoft identifies error code 0x8007018b as a situation where a file is open or in use by OneDrive.

Rank #2
Amazon Basics 3-Button USB Wired Mouse with Responsive Tracking, Plug & Play, Compatible with Windows and Mac, Black
  • Computer mouse for easily navigating a computer interface; click, scroll, and more
  • USB-A wired connection; if existing device only supports USB-C, an additional adapter will be required
  • High-definition (1000 dpi) optical tracking ensures responsive cursor control for precise tracking and easy text selection
  • 3 buttons offer effortless fingertip control
  • Plug-and-go ready for instant use

If Windows says “Access is denied”

Check permissions on the exact file rather than changing permissions across a drive or folder. In File Explorer, right-click the file and select Properties > Security. Review the permissions for your current account. For a OneDrive for Business sync problem, Microsoft’s guidance says to check that the account has Read and Write permissions; that advice is specific to that business sync scenario and may not match personal OneDrive or managed-device policies. See Microsoft’s OneDrive sync troubleshooting guidance.

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

Do not take ownership or grant Full Control indiscriminately. System files and organization-managed files may have permissions set deliberately, and changing them can create access or security problems. If this is a work or school device, ask the administrator responsible for the file.

Rank #3
Sale
Logitech M185 Compact Ambidextrous Wireless Mouse with Rubber Grips - Blue | Ambidextrous mouse with 2.4 GHz USB-A Nano Receiver, Optical Tracking, 12-Months Battery Life, PC, Mac, Laptop compatible
  • Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
  • Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
  • Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
  • Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
  • Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)

If the file is in OneDrive, decide whether you mean the local copy or the cloud file

OneDrive errors can reflect sync activity rather than a normal local-file lock. For error 0x8007018b, Microsoft recommends waiting for synchronization to finish or closing OneDrive before trying again. Microsoft’s OneDrive sync guidance covers this error.

Before deleting anything, decide which result you want. Deleting an item from a synced OneDrive folder can delete it from OneDrive and other synced locations too; it is not necessarily a way to remove only the local copy. If you want to keep the cloud file but free local space, use OneDrive’s Files On-Demand or selective sync options instead of deleting the item. Microsoft describes the available approaches in its Files On-Demand guidance and folder-sync guidance.

Rank #4
Sale
Logitech B100 Ambidextrous Wired Mouse - Black | USB corded, right or left hand use, for computer and laptop
  • A comfortable, ambidextrous shape feels good in either hand, so you feel more comfortable as you work-even at the end of the day
  • With 800 dpi sensitivity, you'll get precise cursor control so you can edit documents and navigate the Web more efficiently
  • Side-to-side scrolling plus zoom lets you instantly zoom in or out and scroll horizontally and vertically; perfect for working with spreadsheets and presentations.
  • Zero setup with flexible connectivity means you just plug it into your USB or PS/2 port-it works right out of the box
  • This mouse is built by Logitech-the mouse experts; it comes with the quality and design we've built into more than a billion mice, more than any other manufacturer

Moving a file out of the OneDrive folder can also affect the cloud item, depending on the workflow. Do not use that as a local-only cleanup method unless you have confirmed what will happen to the cloud copy.

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

If the path or filename may be too long

A deeply nested folder or lengthy filename can trigger a deletion error that sounds like another program is using the file. Microsoft Support describes 260 characters as the default Windows/File Explorer path limit for typical use. The exact behavior varies by app and configuration: enabling long paths in Windows alone does not make File Explorer opt in. Microsoft says a long-path-enabled Windows file system can support paths up to 32,767 characters, but applications must opt in; File Explorer and Office desktop apps do not. See Microsoft’s explanation of path-length behavior.

Best Value
Sale
TECKNET Compact Ambidextrous Wireless Mouse for Laptop Mint Green | 2.4G Quiet Computer Mouse with USB Receiver, 3 Adjustable DPI Portable Cordless Mice for Chromebook, Laptop, PC, Mac
  • 【Special Mint Green Mouse】This is an ideal choice if you need a colorful and cute mouse. Special mint green color and compact size makes it the best mouse for kids and people with small hands.
  • 【Portable Small Mouse】 Only 3.94*2.28*1.52 inches, the usb mouse is designed for small to medium sized hands to achieve optimal fit and comfort. Portable design makes it easy to store in a bag for traveling.
  • 【Soft Click Quiet Mouse】 Responsive buttons and scroll wheel provide very soft click with less noise, no more disturbing others and bring you comfortable using experience.
  • 【Easy to Use Laptop Mouse】 2.4GHz wireless technology ensures reliable connectivity up to 49ft. 3 adjustable DPI levels (1600/1200/800) to meet your different needs. Only need 1xAA battery (NOT included) to support up to 15 months battery life.Note:USB connector is stored inside the back compartment (open the cover to access).
  • 【Universal Compatibility】The wireless mouse is well compatible with Windows11/10/8.1/7,Mac OS . Fits for desktop, laptop, PC, and other devices.
  • Shorten the filename or one of its parent folder names, then try again.
  • Move the file closer to the drive root, such as into a shorter folder path, and retry. Avoid moving it if doing so would disrupt an application or sync workflow.
  • If the item is in OneDrive or SharePoint and File Explorer cannot handle the path, consider renaming it through the web interface. Confirm that you are acting on the correct cloud item.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

If the filename contains unusual characters or a reserved name

Windows has special handling for names that are invalid or reserved in ordinary Win32 paths. Microsoft identifies names such as lpt1 and filenames ending in a space or period as cases that can require specialized handling. These are uncommon cases; do not start with advanced commands unless the filename itself gives you reason to suspect one.

Microsoft’s NTFS troubleshooting article documents specialized path syntax and commands for these cases. Because a small path mistake can target a different file, verify the full path character by character before using any advanced method. If you are unsure, seek help from someone who can inspect the exact path rather than guessing at a command.

If you suspect file-system corruption

Consider disk repair only when Windows reports disk errors or other evidence points to a file-system problem, not just because one file will not delete. Microsoft lists file-system corruption as a possible cause and recommends CHKDSK in relevant cases. CHKDSK can return a file system to an internally consistent state, but Microsoft warns that it may or may not recover file data. Back up important files first when possible, and understand the risk before running repair tools. See Microsoft’s NTFS troubleshooting guidance.

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

Choose the next step by the evidence

What you see First response
“File is in use” or another-program message Close likely apps, finish active operations, then restart if needed. If OneDrive error 0x8007018b appears, wait for sync or close OneDrive.
“Access is denied” Inspect the current account’s permissions on the exact file; avoid broad permission changes.
File is in a OneDrive folder Determine whether you want to delete the cloud item or only remove the local copy before acting.
Very long folder path or filename Shorten the name or path; for OneDrive or SharePoint, consider a web rename if Explorer cannot handle it.
Reserved or unusual filename Use specialized handling only after verifying the full target path.
Windows reports disk errors Back up important data and consider file-system repair with its recovery limitations in mind.

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.

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.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.