I see in your replies that you reference the 8.3 folder names. Here is a Powershell script that will try to delete files/folders one by one recursively using the 8.3 name. If it encounters an error on a delete it will pause. I would suggest just stopping the script at that point because you'll just get more errors when it tries to delete the parent folders.
See if it gives you any more information about what it can't delete.
# https://stackoverflow.com/questions/16995359/get-childitem-equivalent-of-dir-x
function Get-ShortPathName
{
Param([string] $path)
$MethodDefinition = @'
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, EntryPoint = "GetShortPathNameW", SetLastError = true)]
public static extern int GetShortPathName(string pathName, System.Text.StringBuilder shortName, int cbShortName);
'@
$Kernel32 = Add-Type -MemberDefinition $MethodDefinition -Name 'Kernel32' -Namespace 'Win32' -PassThru
$shortPath = New-Object System.Text.StringBuilder(500)
$retVal = $Kernel32::GetShortPathName($path, $shortPath, $shortPath.Capacity)
return $shortPath.ToString()
}
Function LookDeeper($pf){
if ($pf.substring(0,1) -match 'c') {
"I do not process the C drive."
return
}
if ((get-item $pf).LinkType -eq "SymbolicLink") {
"Its a SymbolicLink. Skipping. $pf"
return
}
$sn = Get-ShortPathName $pf # get 8.3 name
if ($sn -eq "") {
"No shortname, unable to continue processing $pf"
return
}
try {
$sf = Get-ChildItem $sn -Directory -force -ErrorAction Stop # get a list of all subdirectories
foreach ($f in $sf){
LookDeeper($f.fullname) # analyze the subfolder
}
$sf = Get-ChildItem $sn -force -ErrorAction Stop # get a collection of everything
foreach ($f in $sf){
$sn = Get-ShortPathName $f.fullname # isssue delete for 8.3 name
if ($sn -eq "") {
"No shortname, skippng {0}" -f $f.fullname
} else {
"Removing $sn "
if ((get-item $sn).LinkType -eq "SymbolicLink") {
"Above file is a SymbolicLink."
(get-item $sn).delete()
} else {
remove-item $sn -force -ErrorAction Stop # add the -WhatIf switch to test without actually deleting anything.
}
}
}
} catch {
""
"Crash: {0} " -f $_.exception
""
"Item analysis......."
Get-Item $sn | Format-List -Property *
pause
}
}
Set-Location 'G:\old\'
LookDeeper('G:\old\Operations (OPS) - HAN') # this starts the recursive delete