I uninstalled an application using the product's official MSI package, it worked as expected but seems to have left a 'phantom' folder behind which is blocking my next installation.
I'm 99% sure I can resolve this issue by simply restarting the host, but in the interest of finding a smoother solution (let's just pretend this is a production server that cannot be swiftly restarted) I thought I would provide some info here and see what comes to light.
Some notes:
- All commands were run in an elevated prompt.
- My account is a member of the Local Administrators group.
The folder path contains Personally Identifiable Information and has therefore been redacted.
Attempting to DELETE the folder using PowerShell (elevated)
[Remove-Item], ItemNotFoundException
Cannot find path 'C:\ProgramData\FOLDER' because it does not exist
PermissionDenied: (C:\ProgramData\FOLDER:String)
[Remove-Item], UnauthorizedAccessException
Attempting to ACCESS the folder using File Explorer
C:\ProgramData\Folder is not accessible
Attempted to DELETE the folder using File Explorer
- The delete action prompts for elevation.
- Upon elevating, it fails with this message.
Viewing the Security tab of the folders properties
- I did have access to this folder prior to the uninstallation. I don't think this matters, as we're looking at the properties of a folder that doesn't actually exist. I am unable to give myself access or claim ownership of this folder, all actions fail.
What has caused this folder to remain in File Explorer when it no longer exists, and what methods are available to 'nuke' the folder (with exception to restarting the OS)?
For those (quite rightly) thinking of flagging this as a duplicate, none of these worked: 1. How do I delete a file that Windows says doesn't exist? 2. Cannot Delete Item "Could Not Find This Item" issue 3. How to fix a directory that is there but doesn't exist? 4. About 6 other solutions also tried
<util:RemoveFolderEx On="uninstall" Property="ProgramDataDirectory" />