2

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:

  1. All commands were run in an elevated prompt.
  2. 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

5
  • Have you tried just restarting explorer? Note also that the uninstaller may have used an option to delete files/folders on the next boot.
    – DavidPostill
    Commented Oct 23, 2019 at 20:03
  • Hi @DavidPostill, yes I did try killing and restarting explorer - good suggestion though. I happen to have the MSI build source for this installer, the folder is deleted on 'uninstall': <util:RemoveFolderEx On="uninstall" Property="ProgramDataDirectory" />
    – Arbiter
    Commented Oct 23, 2019 at 20:10
  • Run "chkdsk" with no switches in command prompt, it may fix it, no switches means read only no repair, but I have had it fix issues like this without the F or R.
    – Moab
    Commented Oct 23, 2019 at 21:28
  • In addition to running chkdsk reboot your system. I had a case where the reboot was required to finally make a directory disappear the MSI deinstaller of LibreOffice had left over (that directory was also giving permission errors despite the account deleting it was local admin).
    – Robert
    Commented Oct 24, 2019 at 15:22
  • I did end up rebooting the host, I was hoping there would be a smoother option. I'm glad it was just my home PC and not a production server in the office!
    – Arbiter
    Commented Oct 24, 2019 at 18:24

0

You must log in to answer this question.

Browse other questions tagged .