How to Force Take Ownership of Locked Folders When Security Tab Disappears in Windows Server 2003


2 views

When dealing with Windows Server 2003 (especially x64 SP2), we occasionally encounter folders that become completely locked - no security tab, no ownership changes allowed through standard methods. This typically happens after bulk operations where ACL inheritance gets corrupted.

Before attempting any fixes, verify these critical points:

icacls "C:\problem_folder" /save permbackup.txt /T /C
dir /q "C:\problem_folder"

When all standard tools (takeown, subinacl) fail, we need to manipulate permissions at the filesystem driver level. Here's a PowerShell workaround that bypasses normal permission checks:

$folder = "C:\locked_folder"
$newOwner = "BUILTIN\Administrators"
$sd = New-Object System.Security.AccessControl.DirectorySecurity
$owner = New-Object System.Security.Principal.NTAccount($newOwner)
$sd.SetOwner($owner)
[System.IO.Directory]::SetAccessControl($folder, $sd)

Sometimes the issue stems from corrupted system defaults. Reset folder permission templates:

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "EncryptionContextMenu" /t REG_DWORD /d 1 /f
secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose

For stubborn cases, create a junction point to "short-circuit" permission inheritance:

mklink /J C:\temp\bypass C:\locked_folder
icacls C:\temp\bypass /reset /T /C /L

To avoid this situation in the future:

  • Always use robocopy /MIR instead of Explorer for bulk operations
  • Maintain regular secedit /export backups of security policies
  • Implement scheduled chkntfs /x scans

Yesterday I encountered one of those Windows Server quirks that makes you question your career choices. After bulk-deleting thousands of temp files from a production server (Windows Server 2003 x64 SP2), the parent folder became completely inaccessible - throwing "Access Denied" errors for all operations. What makes this particularly nasty:

  • Security tab disappeared from Properties (only General/Customize visible)
  • Standard ownership tools (takeown.exe, subinacl) failed
  • Permission inheritance broken despite admin privileges

First, let's verify this isn't just permission masking. Open cmd as Administrator and run:

cacls "C:\problem_folder" /T /C

If you see "Unable to display security information" rather than ACL entries, we're dealing with filesystem corruption. The missing Security tab confirms this.

When standard tools fail, we need to go deeper. Try this PowerShell-inspired approach (works in cmd):

set __COMPAT_LAYER=RunAsInvoker
icacls "C:\problem_folder" /setowner "Administrators" /T /C /Q
icacls "C:\problem_folder" /grant:r Administrators:(F) /T /C /Q

The compatibility layer trick often bypasses permission checks that block standard admin tools. The /Q switch suppresses success messages which sometimes hang on corrupted folders.

If ICACLS fails, we need to manipulate the NTFS structures directly. Create a VB script (takeowner.vbs):

Set objFolder = CreateObject("Scripting.FileSystemObject").GetFolder("C:\problem_folder")
objFolder.Attributes = objFolder.Attributes And Not 1 'Remove read-only
Set objSecurity = CreateObject("ADsSecurity")
objSecurity.SetOwner CreateObject("WinNT://./Administrators,group")
objFolder.SetSecurityDescriptor objSecurity

Run with:

wscript.exe //B takeowner.vbs

Once you regain access, immediately:

chkdsk C: /f /r
fsutil behavior set disablelastaccess 1

Add this registry tweak to prevent similar issues:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"NtfsDisable8dot3NameCreation"=dword:00000001