News, tips, advice, support for Windows, Office, PCs & more. Tech help. No bull. We're community supported by donations from our Plus Members, and proud of it
Home icon Home icon Home icon Email icon RSS icon
  • How do you delete a file when Win7 won't let you?

    Home Forums AskWoody support Windows Windows 7 Questions: Windows 7 How do you delete a file when Win7 won't let you?

    • This topic has 21 replies, 11 voices, and was last updated 6 months ago.
    Viewing 16 reply threads
    • Author
      Posts
      • #2139189 Reply
        opti1
        AskWoody Plus

        Running Win7 Home Premium SP1 64-bit (for a little while longer).

        I’m trying to delete a file in a subfolder in C:\Program Data\ but I keep getting File Access Denied.

        Malwarebytes dropped an updated mbam-setup.exe file into my C:\Program Data folder that launches intrusive pop up windows that prompt to update Malwarebytes Anti-Malware (MBAM). They give no further details about what the update is. These windows pop up at every Windows log on and every time I launch MBAM.

        This ‘update’ actually is a full upgrade to the current MBAM v4. I do not want to upgrade to MBAM v4 at this time on our Win7 PCs which I soon will replace with new Win10 PCs.

        The solution to stop the pop up windows is to delete mbam-setup.exe from C:\Program Data but I am not able to do so.

        When I log on as Administrator and try to delete the file, Windows says File Access Denied – You need permission from UserA to delete this file.

        When I log on as UserA and try to delete the file, Windows says File Access Denied – You need Administrator permission to delete the file. I enter the Administrator password and Windows says File Access Denied – You need permission from UserA to delete this file.

        My head is spinning from all the searching I have done to try to find a way to delete this file without causing collateral damage. It seems there is no magic bullet – some solutions work some of the time, sometimes no solutions work.

        I have considered uninstalling and reinstalling MBAM to see if that deletes the file and replaces it with the old one again but I am apprehensive that this will go bad and leave me in a state where the new file is still there and I no longer have a working MBAM.

        What is your go to solution for deleting a file when Windows 7 doesn’t want to let you do that?

        If it matters, I’m pretty sure we installed MBAM from the UserA standard account after supplying the Administrator password when asked for it.

        Thanks for any suggestions or comments.

      • #2139238 Reply
        geekdom
        AskWoody Plus

        Try renaming this file to something else such as mbam-setup-old.exe.

        Reboot and see if the “prompts” stop.

        G{ot backup} TestBeta
        offline▸ Win10Pro 2004.19041.572 x64 i3-3220 RAM8GB HDD Firefox83.0b3
        WindowsDefender
        online▸ Win10Pro 2004.19041.572 x64 i5-9400 RAM16GB HDD Firefox83.0b4 WindowsDefender
        TargetReleaseVersion=1909
        WUMgr
        1 user thanked author for this post.
      • #2139252 Reply
        anonymous
        Guest

        Elevate user a to administrator. Delete and drop back to standard user. Also maybe try safe mode.

        2 users thanked author for this post.
      • #2139294 Reply
        anonymous
        Guest

        Two suggestions, the 1st quite brutal, the 2nd very brutal, so use both with care:

        1. Use the “Take Ownership” Windows Explorer right mouse option to take ownership of the file. There is an explanation of how to do this manually at https://www.howtogeek.com/howto/windows-vista/add-take-ownership-to-explorer-right-click-menu-in-vista/ . However towards the end of that page is a link to what is described as “Take Ownership Menu Hacks” which allows you to download the Registry changes to do this more easily. I’ve downloaded this and it (still) matches the changes which I have long used (apart from the 3 lines of comment at the start). Merge this into your Registry by double clicking the .reg file. I forget if you need to restart Explorer or your PC for this to work. Then select your file and on clicking your right hand mouse/touchpad button you should see a “Take Ownership” option. Select it for your highlighted file and it should change the file’s ownership to you. (If your PC is slow you may see a flash of a command window making the change. If your PC is fast you may not see this. There is also a .reg file to undo these changes, but I have not tried this as I like having the “Take Ownership” option just in case.)
        2. Start your PC using Linux (if already installed in a dual-boot arrangement or from a Linux installation disk/USB stick – do not install Linux, just “try it” or words to that effect, so read the screens which appear carefully), find your file using the Linux version of “Explorer” and delete or rename it as required. (I once needed to do this to copy a missing Windows 10 boot file from another PC via a USB stick, when the PC would not boot during a “feature update”. It had deleted the file and not put a replacement in place. Using Linux to fix Windows 10 – what joy!)

        HTH. Garbo.

         

        1 user thanked author for this post.
      • #2139405 Reply
        Alex5723
        AskWoody Plus

        Have you tried deleting in ‘Safe Mode’ ?

        1 user thanked author for this post.
      • #2140001 Reply
        opti1
        AskWoody Plus

        Try renaming this file to something else such as mbam-setup-old.exe.

        Reboot and see if the “prompts” stop.

        Thanks for the suggestion.

        I tried to rename the file, tried to move it, and tried to delete it, but I am not able to access the file to do anything with it.

      • #2140004 Reply
        opti1
        AskWoody Plus

        Elevate user a to administrator. Delete and drop back to standard user. Also maybe try safe mode.

        Thanks for your suggestions.

        I like your idea to elevate UserA to Administrator level to try to delete the file and then drop UserA back to Standard. I’ll take a look at how to do that.

        Is this typically a safe process that doesn’t cause collateral damage or would I be taking some risks by doing this?

        Thanks!

      • #2140011 Reply
        opti1
        AskWoody Plus

        Two suggestions, the 1st quite brutal, the 2nd very brutal, so use both with care:

        1. Use the “Take Ownership” Windows Explorer right mouse option to take ownership of the file. There is an explanation of how to do this manually at https://www.howtogeek.com/howto/windows-vista/add-take-ownership-to-explorer-right-click-menu-in-vista/ . However towards the end of that page is a link to what is described as “Take Ownership Menu Hacks” which allows you to download the Registry changes to do this more easily. I’ve downloaded this and it (still) matches the changes which I have long used (apart from the 3 lines of comment at the start). Merge this into your Registry by double clicking the .reg file. I forget if you need to restart Explorer or your PC for this to work. Then select your file and on clicking your right hand mouse/touchpad button you should see a “Take Ownership” option. Select it for your highlighted file and it should change the file’s ownership to you. (If your PC is slow you may see a flash of a command window making the change. If your PC is fast you may not see this. There is also a .reg file to undo these changes, but I have not tried this as I like having the “Take Ownership” option just in case.)
        2. Start your PC using Linux (if already installed in a dual-boot arrangement or from a Linux installation disk/USB stick – do not install Linux, just “try it” or words to that effect, so read the screens which appear carefully), find your file using the Linux version of “Explorer” and delete or rename it as required. (I once needed to do this to copy a missing Windows 10 boot file from another PC via a USB stick, when the PC would not boot during a “feature update”. It had deleted the file and not put a replacement in place. Using Linux to fix Windows 10 – what joy!)

        HTH. Garbo.

         

        Thanks for your suggestions.

        Ha. Yes, I saw both of those suggestions in my research. My head already was spinning by then and those two cranked it up a couple of notches.

        Brutal and very brutal give me hives so I have filed them away in case I don’t find a solution that’s a bit more comfortable for me.

        Thanks!

        • #2140022 Reply
          jabeattyauditor
          AskWoody Lounger

          Brutal and very brutal give me hives so I have filed them away in case I don’t find a solution that’s a bit more comfortable for me.

          There is nothing inherently “brutal” or dangerous in changing ownership of a file that you intend to delete!

          If this were my PC, I’d use File Explorer to change ownership if the offending file, then wipe it ASAP… and I wouldn’t even begin to sweat about it.

          Btw, this function is built-in to Windows 7’s File Explorer – you don’t have to hack it using Vista-specific instructions. Here’s a quick tutorial.

          1 user thanked author for this post.
          b
      • #2140017 Reply
        opti1
        AskWoody Plus

        Have you tried deleting in ‘Safe Mode’ ?

        Thanks for your suggestion.

        No I haven’t tried Safe Mode. For some reason I associate that primarily with hardware and driver issues so it hadn’t really occurred to me for this situation although I know it’s there.

        I’ll add it to my list of things to try.

        Thanks!

      • #2140028 Reply
        anonymous
        Guest

        An easy fix may be to not delete the file, but to remove the read & execute permission from all users for that file.  After rebooting it will not run.  https://www.wikihow.com/Change-File-Permissions-on-Windows-7

      • #2140221 Reply
        Ascaris
        AskWoody_MVP

        You could start a command prompt as SYSTEM, which has even more power than Administrator, using Sysinternals’ psexec.  Ned Pyle from MS describes the process in a blog post.  While it says it’s for Vista and 2008, it works fine in 7 too (I’ve used it!).  You can use that procedure to start a SYSTEM command prompt, then del the file, and close the window immediately so you don’t use it for anything else.

        This is a powerful tool, so be sure you are deleting the right file if you do this.

        Whatever method you use to solve this issue, it’s good to have a backup of it the way it is now, just in case.   Of course, that’s a good idea just in gener

        Group "L" (KDE Neon Linux 5.20.1 User Edition, Ubuntu 20.04 base).

      • #2140235 Reply
        OscarCP
        AskWoody Plus

        Have you tried de-installing Malwarebytes (MB) and then installing its latest version from the MB site directly? After creating a restore point just before re-installing it, in order to eject it back into eternal darkness if the problem continues after you have installed it again? And, if that happens, would you also be ready to change to some other known and reputable application that does what MB does?

        In general, this MB issue aside, I would be weary of deleting files Windows does not let one delete. My inclination is this: if they seem to be doing nothing that bothers me, to just let them be.

        Windows 7 Professional, SP1, x64 Group W (ex B) & macOS Mojave + Linux (Mint)

      • #2140273 Reply
        Fred
        AskWoody Plus

        opti1 :
        Malwarebytes has it’s own “complete uninstaller” for Malwarebytes Antimalware, download it from their site;

        MB has a file-unstaller too, try this one

        MB has a very good and helpful helpdesk to guide you through,

        Succes

        ~ ~ ~
      • #2140345 Reply
        garlin
        AskWoody Plus

        The root cause is some applications (this is where AV products get a bad reputation for behaving exactly like malware) are locking files at the system level.  This has nothing to do with insufficient user permissions.

        You have to stop the owner application to release the file lock.  AV products don’t want any random program halting their execution, so they will actively lock entire folders and files.  Safe Mode tends to work, because MBAM or whatever wasn’t running.

        This older article is a good starting on unlocking tools:

        https://www.raymond.cc/blog/lockhunter-is-unlocker-alternative-that-works-on-windows-x64/

        Sometimes a non-AV program will crash, but leave behind file locks which remain across reboots.  This is why file unlockers exist.

      • #2153512 Reply
        opti1
        AskWoody Plus

        Thanks everyone for your responses and suggestions. I have learned a lot from them and I have filed them away for future use.

        Turns out I was able to locate someone who was in exactly the same situation that I was in. He had been able to successfully get back to normal by running the Malwarebytes Support Tool (which deleted the update nag file that Windows would not let me delete) and then reinstalling MBAM.

        I was aware of the Malwarebytes Support Tool (that Fred also suggested above) but I was apprehensive about running it based on things I have read about it. Finding this other fellow who had successfully used it and some additional tips he provided helped me to repeat his success.

        That process took about a half hour from start to finish which included downloading and making sure I had all the required files on the problem PC, running the tool to let it do its thing, checking to make sure the problem file was gone, reinstalling and reactivating the MBAM and MBAE software, and some testing to make sure everything was OK.

        Thanks again everyone!

        1 user thanked author for this post.
        • #2153632 Reply
          Fred
          AskWoody Plus

          Opti1:  thank you for sharing, I am curious if you use MBAM without or with MSDefender?

          I still did notice some difference in speed, while those two are working great together; that’s a bit odd, and possibly scanning in maps that are excluded.

           

          ~ ~ ~
      • #2153652 Reply
        opti1
        AskWoody Plus

        Hi Fred,

        I use MBAM with ESET NOD32 anti-virus only, with no problems and no noticeable slowdown.

        1 user thanked author for this post.
      • #2255209 Reply
        anonymous
        Guest

        I use IObit Unlocker.  It’s free!

        Here is the description from the website:

        IObit Unlocker performs well in solving “cannot delete files”, “access is denied”, “The file is in use by another program or user”, or “There has been a sharing violation” problems. With IObit Unlocker, you can manage all your files the way you want.

        Once you find “cannot delete files”, just simply drag or drop them to IObit Unlocker. Then you can quickly unlock, rename, copy or move them as you wish. No complex operation is needed.

        3 users thanked author for this post.
        • #2256092 Reply
          GoneToPlaid
          AskWoody Plus

          Thank you for this dandy suggestion for using IObit Unlocker. I just finished installing it and trying it. IObit Unlocker works like a charm in other scenarios as well.

    Viewing 16 reply threads

    Please follow the -Lounge Rules- no personal attacks, no swearing, and politics/religion are relegated to the Rants forum.

    Reply To: How do you delete a file when Win7 won't let you?

    You can use BBCodes to format your content.
    Your account can't use Advanced BBCodes, they will be stripped before saving.