Undeletable Files


  1. Posts : 2
    Windows 7 Home Premium 64 Bit
       #1

    Undeletable Files


    Hey,

    I was trying to delete a few .txt files in the Cookie folder, I've tried several programs such as CCleaner, Unlocker, SpyBot Search & Destroy but I cannot delete those files.

    I've also tried to delete them by using commands but it tells me "Access denied" screenshot below.


    I can't delete them no matter what I do. If you have any suggestions / ideas feel free to share.


    Thanks in advance.
      My Computer


  2. Posts : 2,774
    Windows 7 Professional 64-bit
       #2

    EMCO Move [& Delete] on Boot, a freebie, may be your best bet. It's geeky! And it works MOST of the time.
      My Computer


  3. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #3

    Heyas,

    I assume "Zugriff verweigert" translates to "Access denied". Even when forcefully deleting files from an elevated command prompt, you must have enough permissions on the file objects to delete them.

    Attached is a batch file. It deletes all files in the folder it's in (including itself), after it grants the correct permissions on each file in the folder. It deletes quite powerfully, so be absolutely sure that it is in the right location when you run it.

    Preview:
    Code:
    @echo off
    net session >NUL 2>&1|| powershell Start-Process '%0' -Verb RunAs&& exit /b|| exit /b
    pushd "%~dp0"
    takeown /f "*"
    icacls "*" /grant:r "%USERNAME%":f
    attrib "*" -r& attrib %0 +r
    del "*"& popd& del /f %0
    Undeletable Files Attached Files
    Last edited by Pyprohly; 24 Jan 2015 at 22:39. Reason: Fixed: Spaces in paths break command line
      My Computer


  4. Posts : 2
    Windows 7 Home Premium 64 Bit
    Thread Starter
       #4

    Thanks to both of you, I was finally able to remove those .txt files.
      My Computer


  5. Posts : 2,774
    Windows 7 Professional 64-bit
       #5

    Pyprohly, I added the following two lines to my copy of your very good batchfile:
    rem powershell delete present files & present directory
    rem Ensure this BATchfile is in desired directory to delete; if not, CTRL-BREAK now.

    -- will that work? Or, am I mistaken about Powershell??
      My Computer


  6. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #6

    Hi Roland,

    RolandJS said:
    [W]ill that work? Or, am I mistaken about Powershell??
    Could you clarify what you are asking?

    And I do not recommend you keep a copy of this batch file, or edit it in anyway. It's dangerous(ly powerful).
      My Computer


  7. Posts : 2,774
    Windows 7 Professional 64-bit
       #7

    Ahhh, I finally remembered this thread, yes, batchfile iced into my HD "freezer."
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 03:49.
Find Us