takeown/f<path_to_windows_folder>/r/d y.
Use the command icacls<path_to_windows_folder>/grant administrators: F/t to give the administrator group full control permissions.
Then try deleting the folder. If it still cannot be deleted, use the command rd/s/q<path_to_windows_folder>to forcibly delete the folder and its contents.
=========================================================================
$ConfirmPreference = “None”
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not KaTeX parse error: Expected '}', got 'EOF' at end of input: …rofile -File `"PSCommandPath`“” -Verb RunAs
exit
}
Set-ExecutionPolicy -ExecutionPolicy bypass
Install-Module -Name NtObjectManager
Start-Service -Name TrustedInstaller
$parent = Get-NtProcess -ServiceName TrustedInstaller
$proc = New-Win32Process cmd.exe -CreationFlags NewConsole -ParentProcess $parent
$ConfirmPreference = “High”