Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Windows 10’s rmdir (also called rd) returns “Access is denied” when the target is being used, contains hidden or system entries, is the shell’s current directory, or your account lacks the required ownership or ACL rights. Start by checking the path and contents, then close programs, use an elevated terminal, and only afterward investigate ownership and permissions. The commands below let you identify the cause before making a potentially destructive change.
What does “rmdir access denied” mean on Windows 10?
The message does not identify one single fault. Windows is refusing the directory operation for a reason that can usually be separated into four categories:
As an Amazon Associate I earn from qualifying purchases.
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 errors- Wrong target or current directory: the command points at a different folder than intended, or the terminal is currently inside the folder you want to remove.
- Hidden or system contents: the directory appears empty in Explorer but contains entries that normal listings do not show.
- Active use: an application, game launcher, background process, or File Explorer window has a file or subfolder open.
- Security permissions: an ACL denies deletion, or your account does not own the folder. Elevation, ownership recovery, and permission changes are separate remedies.
Microsoft documents that rmdir and rd are equivalent commands on Windows 10, and specifically states: “You can’t use the rmdir command to delete the current directory.” Treat every command below as an example: replace the sample path with the exact directory you intend to remove.
How do I confirm the path and avoid deleting the wrong folder?
Verify the target before changing permissions or using a recursive delete. A typo, an unquoted space, or a relative path can send the command somewhere else.
#1 Best Overall
- Spacious Design: Measuring 21.1" wide and 14.1" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
- Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy ergonomic support with the integrated cushioned wrist rest.
- Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
- Durable Surface: Work with confidence on our lap desk's solid surface, featuring a sleek black carbon color, ensuring optimal air circulation to prevent your laptop from overheating.
- On-the-Go Convenience: With an integrated handle and lightweight design (2.8 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
Use a fully qualified, quoted path
Put quotation marks around any path that contains spaces:
rmdir /s "C:UsersYourNameDownloadsOld folder"
Do not use a drive root, the entire user profile, or another broad path as a test. Replace YourName and Old folder with the real values shown in File Explorer’s address bar. If you copied the path, check for an extra trailing quote or a different drive letter.
Move the terminal outside the target
If Command Prompt or PowerShell is currently inside the directory, move to its parent or to the drive root first. For example:
cd /d C:UsersYourNameDownloads
rmdir /s "C:UsersYourNameDownloadsOld folder"
Using an absolute path makes the operation clear and avoids accidentally removing a similarly named folder in the current location. If the target is the current directory itself, leave it with cd .. (or another directory) before retrying.
How can I tell whether hidden or system files are blocking removal?
A normal directory listing can omit hidden and system entries. Microsoft identifies those entries as a reason a directory may remain nonempty even when Explorer looks empty.
List every entry first
Run this inspection command from any location:
dir /a "C:pathtofolder"
The /a switch includes entries with hidden and system attributes. Read the output carefully and note files or subfolders you still need. If the listing contains a file created by an application, close that application before deleting the directory. Do not remove attributes merely to force a deletion when you do not understand what the file does; system-marked content can be important to Windows or an installed program.
Recommended Free Tools
Use PowerShell only for item attributes, not security bypass
PowerShell can remove hidden or read-only items with -Force when the account already has permission:
Rank #2
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Remove-Item -LiteralPath "C:pathtofolder" -Recurse -Force
-Force does not override an ACL denial, ownership restriction, or an open handle. If PowerShell reports that access is denied, return to the permission and in-use checks instead of repeatedly adding switches.
Could another program be using the folder?
Yes. A file open in the target tree can prevent the directory from being removed. This is common with editors, archive tools, installers, game launchers, synchronization clients, antivirus scans, and Explorer previews.
- Save work and close every application that might have opened a file in the directory.
- Close every File Explorer window whose address bar is inside the target or one of its subfolders. Select a different location before closing the last window.
- Close extra Command Prompt and PowerShell windows that are currently in the target.
- Wait for an installer, synchronizer, or launcher to finish, then retry the listing and deletion command.
If the error disappears after these closures, the cause was an active use rather than a missing permission. If it persists, continue with an elevated terminal and ACL inspection rather than deleting unrelated files.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →When should I run Command Prompt or PowerShell as administrator?
Elevation is appropriate when you are authorized to manage the folder and Windows identifies it as administrator-only. It can provide access without changing the folder’s ACL. It is not a reason to alter permissions on Windows operating-system folders.
Open an elevated Command Prompt
- Open the Start menu and type Command Prompt.
- Right-click Command Prompt and choose Run as administrator.
- Approve the User Account Control prompt.
- Use
dir /ato verify the target, move the shell outside it, and retryrmdir /s.
Open an elevated PowerShell window
- Open Start and type PowerShell.
- Right-click Windows PowerShell and select Run as administrator.
- Approve User Account Control.
- Use the same fully qualified path with
Remove-Item, or run thermdircommand from that window.
Elevation does not make an incorrect path safe and does not authorize deleting another person’s data. If an elevated window still receives “Access is denied,” inspect the ACL and ownership rather than assuming the command syntax is wrong.
How do I inspect the folder’s permissions with icacls?
icacls displays the access-control list (ACL) Windows evaluates for the directory. Inspect first so you know which account or group is being denied and whether inheritance is involved.
icacls "C:pathtofolder"
Run it in an elevated terminal when the folder is administrator-only. The output lists identities and permission codes. Look for your account, an administrator group, or an explicit D (delete) denial. A grant on the parent does not always overcome an explicit deny on the target or a child item.
Rank #3
- Note: Not suitable for MacBooks released after 2023 or devices with a protruding front camera; Not applicable to full-screen or notch-style tempered glass screen protectors; Do not use on the rear camera of the phone.
- 💻 Why Do You Need a Webcam Cover Slide? — Safeguard your privacy by covering your webcam with our reliable webcam cover when not in use. Don't let anyone secretly watch you. Stay protected!
- ✅ Thin & Stylish — Enhance your laptop's functionality and aesthetics with our 0.027" ultra-thin webcam covers. Seamlessly close your laptop while adding a touch of sophistication.
- ✅ Fits Most Devices — Compatible with laptops, phones, tablets, desktops! Keep your privacy intact on Ap/ple, Mac/Book, iPh/one, iP/ad, H/P, L/novo, De/ll, Ac/er, As/us, Sa/msung devices.
- ✅ 365 Days Protection — Our upgraded 3.0 adhesive ensures a strong hold that won't damage your equipment. Experience reliable, long-term privacy protection day in and day out.
What the inspection can and cannot tell you
- It shows the ACL currently attached to the path; it does not prove that no process has the folder open.
- It does not make you the owner. Ownership and access rights are different security concepts.
- It does not mean every listed identity should be changed. Removing inherited entries can break an application or a user profile.
Save or copy the output before making a change. That record helps you undo an accidental permission edit and gives an administrator the information needed to diagnose the denial.
How do I take ownership safely?
For a non-system folder that you are authorized to manage, an administrator can use takeown to change ownership. This is a recovery step for an ownership problem, not a general deletion shortcut.
takeown /f "C:pathtofolder"
The command targets the folder itself. If the denied item is inside a tree and you have verified that every descendant belongs to the same application or user data set, the recursive form is:
takeown /f "C:pathtofolder" /r
/r processes descendants, so a typo can affect many files. Never point it at a Windows operating-system directory, a drive root, or a folder containing data you have not identified.
Why ownership alone may not fix the error
Taking ownership changes who controls the security descriptor; it does not automatically grant every permission needed to delete all children. Microsoft’s deletion guidance treats ownership recovery and permission granting as separate steps. After takeown, run icacls again and have an administrator grant only the rights required for this specific folder, using the folder’s Security settings or a carefully scoped icacls change. Avoid broad, recursive grants when a single directory is the problem.
How do I grant the minimum permission needed?
Permission changes should be limited to a non-system target you are authorized to administer. In File Explorer, right-click the folder, choose Properties, open the Security tab, and select Advanced to review the owner, inherited entries, and explicit denies. Change only the account that needs to remove the folder, and preserve inherited entries unless you have a documented reason to stop inheritance.
If you use icacls to grant access, identify the exact account, quote the path, and avoid applying a command to the entire drive. A permission that includes child-object inheritance affects descendants, so verify the scope before confirming. After the change, rerun icacls to confirm the resulting ACL, then test deletion on the intended path only.
Rank #4
- Anti-Slip Surface - Transform your laptop into a mobile workstation with the AboveTEK portable laptop lap desk. The anti-slip surface provides a strong grip for laptops up to 15.6 inches(Diagonal), while the double rubber strip on the bottom ensures a stable display or typing experience on your lap, couch, or bed.
- Retractable Mouse Pad - Retractable laptop mouse pad extends on both directions for the left/right handed with elevation along the edges for stopping mouse from falling off. The size of laptop tray is 14" X 9.7" and the size of mouse pad is 7.4" X 6.1".
- Effective Heat Shield - The effective heat shield made of sturdy and thick material protects your laptop from overheating. Prioritizes your comfort and safety, an ideal lap pad or board for working anywhere.
- EASY to Carry and Store - With an ergonomic and simplistic design, the lap desk is portable to store in a backpack. Only 15" in size, 2.2 lb of weight and with slim 0.6 inch thickness, it is ready to be easily carried around.
- Widely Applicable - The smooth platform accommodates laptops and tablets up to 15.6 inches(Diagonal), making it a versatile accessory and one of the best gifts for mom, dad, students and professionals. Perfect for use as a laptop bed tray or tablet holder anywhere at home, library, or park.
Do not change permissions on folders that belong to Windows. Microsoft specifically warns against doing so; an apparently successful deletion can leave the operating system or installed applications unusable.
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 matchWhat is the correct command to remove the directory?
Once the path is confirmed, contents are understood, applications are closed, and permissions are sufficient, use:
rmdir /s "C:pathtofolder"
The /s switch removes the directory tree, including files and subdirectories, and normally asks for confirmation. The equivalent command is rd /s. To suppress the confirmation prompt, add /q:
rmdir /s /q "C:pathtofolder"
Use /q only after checking the path immediately before execution. It removes the prompt, not the risk. If the command still reports access denied, stop and return to the in-use, elevation, ACL, and ownership checks; do not keep adding unrelated switches.
Which remedy matches the symptom?
| What you observe | Likely cause | Lowest-risk next action | Escalation |
|---|---|---|---|
| The terminal is inside the folder | Current-directory restriction | Change to the parent or another drive location | Retry with an absolute path |
| Explorer looks empty but removal says the directory is not empty | Hidden or system entries | Run dir /a |
Close the owning application; use PowerShell -Force only when permission already exists |
| Error appears while a document, archive, or installer is open | Active file handle | Close the application and Explorer windows | Wait for background work to finish, then retry |
| An elevated terminal still receives access denied | ACL or ownership restriction | Run icacls to inspect entries |
Use takeown only on an authorized, non-system target, then grant narrowly scoped rights |
| Target is part of Windows itself | Protected operating-system content | Do not alter permissions or delete it | Use the supported Windows feature or uninstall procedure instead |
What should I avoid when fixing this error?
- Do not run an unquoted path containing spaces. The command may interpret only the first word as the target.
- Do not use
/qbefore checking the path. It removes the confirmation prompt. - Do not use
/rownership recovery casually. It processes every descendant and can alter a large tree. - Do not change ACLs on Windows folders. An administrator prompt does not make those changes safe.
- Do not assume
-Forcebypasses security. It handles hidden or read-only attributes when you already have access; it does not override an ACL denial. - Do not delete files merely because they are hidden or marked system. First identify which program or Windows component created them.
What if the commands still fail?
Use the failure message to choose the next diagnostic rather than repeating the same deletion command.
The path is not found
Copy the path again from File Explorer, confirm the drive letter, and use dir /a on the parent directory. A renamed folder, disconnected drive, or typo is different from an access denial.
The directory is not empty
Run dir /a and inspect every listed entry. Hidden and system files are the usual explanation; close the application that owns them before trying the recursive delete again.
Best Value
- Spacious Design: Measuring 21.1" wide and 12" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
- Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy laptop support with the integrated device ledge.
- Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
- Durable Surface: Work with confidence on our lap desk's solid surface, featuring a blush pink color, ensuring optimal air circulation to prevent your laptop from overheating.
- On-the-Go Convenience: With an integrated handle and lightweight design (2.14 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
Access is denied after elevation
Run icacls and check the owner and explicit denies. If the folder is a legitimate user or application target, an authorized administrator may need to take ownership and then grant the minimum delete rights. If it is a Windows folder, stop rather than modifying its ACL.
Deletion succeeds for some children but not others
A child can have a different ACL or be in use even when the parent is accessible. Inspect the specific child path with icacls, close the process using it, and avoid applying a blanket permission change to the entire tree.
Free tools Windows power users keep installed
One-click scans. No signup required.
If you prefer an optional shortcut after trying the manual checks, Outbyte PC Repair can look for common Windows issues, settings that create excess resource load, temporary files, and crash-related problems. It complements antivirus software rather than replacing it; results vary, and no tool repairs every crash. It supports Windows 10 and offers a free trial by category before a subscription.
How do I prevent another access-denied deletion?
Keep personal and application data in locations your account is designed to manage, and remove folders through the application’s own uninstall or cleanup option when one exists. Before deleting a shared directory, confirm who owns it and whether another account or service needs the files. When a future command fails, repeat the same order: verify the path, leave the target directory, list all contents, close users of the folder, elevate only when appropriate, inspect the ACL, and change ownership or permissions only on an authorized non-system target.
Frequently Asked Questions
Why does an administrator Command Prompt still say access denied?
Elevation gives the process administrative privileges, but an explicit deny, a different owner, or a locked child file can still block deletion. Inspect the exact path with icacls and check for an application using the child before changing anything.
Are rd and rmdir different commands?
No. Windows treats them as aliases for the same directory-removal command, so the switches and safety considerations are the same. Choose whichever spelling makes your script or instructions clearer.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Can I delete a folder that belongs to Windows if I take ownership first?
You should not. Microsoft warns against changing permissions on Windows folders; use the operating system’s supported repair, reset, or uninstall path instead of forcing removal.
What happens if I use /q by mistake?
When combined with /s, /q suppresses the confirmation prompt, so the directory tree is removed without that final question. Verify the full quoted path immediately before running it and keep backups of files you may need.
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.

