Skip to content
Windows 10 Files are Locked Can’t Delete Use TakeOwn EXE to Delete the Files

Windows 10 Files are Locked Can’t Delete Use TakeOwn EXE to Delete the Files

Written By Anoop C Nair
Last Updated July 12, 2024
Posted In Windows 10
SHARE

Windows 10 Files are Locked and Can’t Delete. Use TakeOwn EXE and Delete the Files. The good news is that TakeOwn.exe works with Windows 10 versions. TakeOwn.exe is a command-line tool that can take ownership of files and folders.

This tool works well with PowerShell and command prompts. Now, you may think, why Powershell? As part of the PowerShell learning process, I’ve removed command prompt shortcuts from Windows 10 laptops. So, by default, I use PowerShell for everything, not the command prompt.

/D prompt Default answer is used when the current user cannot access the “list folder” in a directory. This occurs while operating recursively (/R) on sub-directories. Valid
values “Y” to take ownership or “N” to skip.

In this post, you will get all the details of Windows 10 Files that are Locked and Can’t Delete. Use TakeOwn EXE to Delete the Files.

Patch My PC
Index
Windows 10 Files are Locked Can’t Delete Use TakeOwn.EXE to Delete the Files
Windows 10 Files are Locked
Windows 10 Files are Locked Can’t Delete Use TakeOwn EXE to Delete the Files – Table 1

Windows 10 Files are Locked Can’t Delete Use TakeOwn.EXE to Delete the Files

Try checking Windows 10 Files are Locked Can’t Delete Use TakeOwn.EXE to Delete the Files?

Windows 10 Files are Locked Can't Delete Use TakeOwn EXE to Delete the Files - Fig.1
Windows 10 Files are Locked Can’t Delete Use TakeOwn EXE to Delete the Files – Fig.1

Following are the takeown.exe commands I tried from Powershell and the command prompt.

PowerShell = PS C:\> takeown /f .\Windows.old /r /d y

Command prompt = C:\>takeown /f C:\Windows.old /r /d y

  • /F filename Specifies the filename or directory name pattern. Wildcard “*” can be used to specify the pattern. Allows sharename\filename.
  • /R Recurse: instructs the tool to operate on files in specified directories and all subdirectories.
Windows 10 Files are Locked Can't Delete Use TakeOwn EXE to Delete the Files - Fig.2
Windows 10 Files are Locked Can’t Delete Use TakeOwn EXE to Delete the Files – Fig.2

Windows 10 Files are Locked

The results of the Take Ownership utility are similar to the screenshot below. This TakeOwn utility can be used when you cannot delete any files or folders, even if you have full admin access on your Windows Machine. Random files getting locked and can’t be deleted is a very common problem in Windows.

In case TakeOwn.exe doesn’t work for you, I would suggest trying PSEXEC with system account/machine account privileges to delete a file or folder from a Windows 10 machine. I’ve explained this process here: “How to Run Application or Process from SYSTEM Context or Account“.

SUCCESS: The file (or folder): "C:\Windows.old\WINDOWS\winsxs\x86_wwf-system.workflow.activities_31bf3856ad364e35_6.1.7601.17514_none_346d5ccdd640c664\System.Workflow.Activities.d
ll" now owned by user "ACN\Anoop".
SUCCESS: The file (or folder): "C:\Windows.old\WINDOWS\winsxs\x86_wwf-system.workflow.componentmodel_31bf3856ad364e35_6.1.7601.17514_none_8deb83646c57c1d5\System.Workflow.Componen
tModel.dll" now owned by user "ACN\Anoop".

SUCCESS: The file (or folder): “C:\Windows.old\WINDOWS\winsxs\x86_wwf-system.workflow.runtime_31bf3856ad364e35_6.1.7601.17514_none_67224784fe4912e9\System.Workflow.Runtime.dll” now owned by user “ACN\Anoop“.

Windows 10 Files are Locked Can't Delete Use TakeOwn EXE to Delete the Files - Fig.3
Windows 10 Files are Locked Can’t Delete Use TakeOwn EXE to Delete the Files – Fig.3

More help on taking the Ownership tool!

Takeown C:/Windows.old\*

PS C:\WINDOWS\system32> Takeown /?

TAKEOWN [/S system [/U username [/P [password]]]]
/F filename [/A] [/R [/D prompt]]

Description

  • This tool allows an administrator to recover access to a file denied by re-assigning file ownership.

Parameter List:

  • /S system Specifies the remote system to connect to.
  • /U [domain\]user Specifies the user context under which the command should execute.
  • /P [password] Specifies the password for the given user context. Prompts for input if omitted.
  • /F filename Specifies the filename or directory name pattern. Wildcard “*” can be used to specify the pattern. Allows sharename\filename.
  • /A Gives ownership to the administrators group instead of the current user.
  • /R Recurse: instructs the tool to operate on files in specified directory and all subdirectories.
  • /D prompt Default answer is used when the current user does not have the “list folder” permission
    on a directory. This occurs while operating recursively (/R) on sub-directories. Valid
    values “Y” to take ownership or “N” to skip.
  • /SKIPSL Do not follow symbolic links. Only applicable with /R.
  • /? Displays this help message.

NOTE

  • 1) If /A is not specified, file ownership will be given to the
    currently logged-on user.
  • 2) Mixed patterns using “?” and “*” are not supported.
  • 3) /D is used to suppress the confirmation prompt.
Examples
TAKEOWN /?
TAKEOWN /F lostfile
TAKEOWN /F \\system\share\lostfile /A
TAKEOWN /F directory /R /D N
TAKEOWN /F directory /R /A
TAKEOWN /F *
TAKEOWN /F C:\Windows\System32\acme.exe
TAKEOWN /F C:\Windows\System32\acme.exe
TAKEOWN /S system /F MyShare\Acme*.doc
TAKEOWN /S system /U user /F MyShare\MyBinary.dll
TAKEOWN /S system /U domain\user /P password /F share\filename
TAKEOWN /S system /U user /P password /F Doc\Report.doc /A
TAKEOWN /S system /U user /P password /F Myshare\*
TAKEOWN /S system /U user /P password /F Home\Logon /R
TAKEOWN /S system /U user /P password /F Myshare\directory /R /A
Windows 10 Files are Locked Can’t Delete Use TakeOwn EXE to Delete the Files – Table 2

Resources

Windows 10 Latest Version Of Client Operating System From Microsoft (anoopcnair.com)

We are on WhatsApp now. To get the latest step-by-step guides, news, and updates, Join our Channel. Click here. HTMD WhatsApp.

Author

Anoop C Nair is Microsoft MVP! He is a Device Management Admin with more than 20 years of experience (calculation done in 2021) in IT. He is a Blogger, Speaker, and Local User Group HTMD Community leader. His main focus is on Device Management technologies like SCCM 2012, Current Branch, and Intune. He writes about ConfigMgr, Windows 11, Windows 10, Azure AD, Microsoft Intune, Windows 365, AVD, etc.

Written by

Anoop C Nair is Workplace Technology solution architect with 25+ years of experience in global enterprise organizations such as JP Morgan, Capgemini, etc. Microsoft Certified Trainer. Microsoft MVP from 2015 onwards for consecutive 11+ years! He also conducts Intune and modern workplace tech training for enterprise organizations. He is Blogger, Speaker, and Founder of HTMD Community and HTMD Conference. His main focus is on Device Management technologies like Intune, Windows, Cloud PC. He writes about technologies like Intune, SCCM, Windows, Cloud PC, Windows, Entra, Microsoft Security.

Discussion · 1 comment

  1. Can I use this method to take ownership of and delete folders that contain windows? I have a separate SSD that I need to be empty, but it has Windows on it with some corrupted or deleted files so I can’t log into that SSD itself, upon trying to log in it says that windows is damaged and can’t be accessed. I put that SSD in a different pc to try and delete everything, but at this point, I’ve tried a lot of ways to delete/format an SSD, but they just don’t work. So is it safe to connect it to a different pc and run the takeown.exe command, take ownership and delete those files/folders, will it mess up/corrupt or do something to the main drive of the pc I have it connected to?

Join the discussion

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

Related guides

Windows 10

New Snipping Tool Vulnerability in Windows can Leak NTLMv2 Hashes over Network

Key Takeaways Hey, let’s discuss about New Snipping Tool Vulnerability in Windows can Leak NTLMv2 Hashes over Network. Microsoft Windows Snipping Tool has a newly disclosed spoofing vulnerability, tracked as CVE-2026-33829, which could allow an unauthenticated attacker to capture a user’s NTLMv2 hash over a network. The issue was made public on April 14, 2026, […]

AC Anoop C Nair 4 min read
Windows 10

Unsupported Windows 10 Devices in Intune may Experience Limited or Unreliable Functionality

Let’s discuss Unsupported Windows 10 Devices in Intune may Experience Limited or Unreliable Functionality. Microsoft Announce the Official end of support announcement of Windows 10 free support on October 14, 2025. There is no more free security updates or non-security fixes via Windows Update for Windows 10 Home and Pro editions. Microsoft announced that, Windows 10 […]

AC Anoop C Nair 4 min read
Intune

Last Patch for Windows 10 with KB5066791 and 5 Zero Day Vulnerabilities and 118 Flaws

Let’s discuss Last Patch for Windows 10 with KB5066791 and 5 Zero Day Vulnerabilities and 118 Flaws. Microsoft Released last Patch Tuesday Updates for Windows 10 on October 2025. After October 14 2025, Microsoft will no longer provide free software updates from Windows Update, technical assistance, or security fixes for Windows 10. As you know […]

AC Anoop C Nair 6 min read
Intune

2025 September KB5065429 Windows 10 Patch | 2 Zero Day Vulnerabilities and 81 Flaws

Let’s discuss 2025 September KB5065429 Windows 10 Patch | 2 Zero Day Vulnerability and 81 Flaws. Microsoft addressed various security fixes and improvements on September 2025 Patch Tuesday of Windows 10 KB5065429. There are many security benefits can be accessed with parch tuesday update. Microsoft dedicated to provides patch Tuesday updates on Windows 11. Mainly […]

AC Anoop C Nair 7 min read