File refuses to be deleted

2

Earlier this week I backed up all of my most important files from my old HD, because I was seeing lots of red flags that it was starting to fail. I put all of my most important folders and files into individual zip folders with no compression using 7zip, and dragged them over onto my external HD.

When I got my new Solid State HD set up with a brand new installation of Windows 10, I decided to keep the files on my external HD until I specifically needed them, and eventually it came time to bring out this file called "7rystan - A New Year.wav". I opened the compressed folder containing my backed up music using Windows (instead of 7zip, which I think was a mistake) and dragged the file over to my new Music folder on my new HD.

Upon trying to right click on the file, my Windows crashed and restarted... so I tried again... and it crashed again. Then I tried opening the file by dragging it into Sony Vegas, and it crashed Sony Vegas.

Eventually I figured the file was corrupted, and tried to delete it... but alas, it will not delete. No matter what measures I go to to get rid of this pesky file, it either crashes the program I'm using, or crashes Windows and causes it to restart. I've gone through dozens of tutorials, and none of them work for this specific file.

I've already tried the following:

  • Restarting
  • Simply deleting the file and even the whole containing folder causes the recycling window to load for eternity
  • Shift + delete to skip sending the file to the recycle bin causes Windows to crash and restart
  • Using 'del' command on Powershell as admin gives me the error "PermissionDenied"
  • Using 'rmdir /q /s 7rystan' (the name of the folder containing the file) causes Windows to crash and restart
  • Eraser gives this error:

    Session: Sunday, September 3, 2017 02:41:21 PM Sunday, September 3, 2017 02:41:22 PM Error The file C:\Users\Trystan\Music\7rystan\WAV\7rystan - A New Year.wav could not be erased because the file was either compressed, encrypted or a sparse file.

  • FileAssassin stops responding
  • Using FileAssassin's 'delete on reboot' option causes it to stop responding
  • Using CCleaner to delete all files in my music folder causes it to stop responding
  • SpaceMonger stops responding
  • Using 7zip to create a zip folder with the "delete original files on finish" option ticked causes it to load for eternity
  • Dragging and dropping the file anywhere causes Windows to crash
  • Scanning Disk for Errors comes back with 0 Errors
  • Virus scan comes back with 0 Viruses

This is the most bothersome bug I've ever experienced. I just reinstalled Windows a few days ago, and I don't want to have to do that again for one single file that's just being a jerk.

Please help. :(

7rystan

Posted 2017-09-03T20:58:03.323

Reputation: 31

4What about using a Linux live-cd? – Sekhemty – 2017-09-03T21:21:40.140

2Have you tried chkdsk /R /x c: Replace C with drive letter of your external drive. – cybernard – 2017-09-03T21:32:20.947

Answers

1

I figured it out!

Seeing as this all started when I opened a zip file with Windows instead of 7zip (which is what I created the zip in originally), I decided to try and open C:\Users\Trystan\Music\7rystan with 7zip instead of with Windows.

Once in there, I turned the WAV folder into an uncompressed zip folder, making sure the compression level was set to "store", and then checked the "delete files after compression" option.

Still within 7zip, I right clicked on the new uncompressed zip folder and deleted it... Not sure why this worked this way but it did. Previously when I had tried doing this with compression it didn't work - doing so with no compression and making sure the compression level was set to "store" seems to have made a difference.

Once it was in the recycle bin, simply "emptying recycle bin" didn't work, but going in and manually deleting it worked just fine. I'm thinking for whatever reason this file was still encrypted as if it were inside of a protected zip folder or something... Super weird.

7rystan

Posted 2017-09-03T20:58:03.323

Reputation: 31

That seems too spurious to have been the cause. Did you try using Unlocker to delete the file after running the commands I suggested? My suspicion is that the ownership/permission commands, which evidently ran successfully based on the output you posted, left the file open to being deleted. – Hashim – 2017-09-04T02:37:36.457

4

I know you say you've tried a lot at this stage, but you don't seem to have made any mention of Unlocker, and it's most of SU's go-to for this purpose, including mine. I can't count the amount of times I've used it successfully for similar scenarios. Have a go at deleting it with Unlocker and let me know how it goes.

In the event that it doesn't work, try either one of the following options.

Take ownership of the file manually

Open a command prompt and enter the following:

takeown /f "PATH" /r /d y && icacls "PATH" /grant administrators:F /t

...where PATH is the path to the file itself. A quick way to get hold of this path is to hold the Shift key while right-clicking on the file, and then select Copy as path from the context menu. Right-click in the CMD window when you're ready to paste it in.

Take ownership of the file from the right-click context menu

If you'd rather skip typing in the above commands manually, or you suspect you'll need to make regular use of them, you can follow the How-To Geek tutorial here to add the Take Ownership item to your right-click context menu, which allows you to run the commands by simply right-clicking on a file.


Once you've done one of the above, try running Unlocker once again and see how far you get this time.

Hashim

Posted 2017-09-03T20:58:03.323

Reputation: 6 967

1+1 for the "shift-copy as path" trick – redbeam_ – 2017-09-03T21:33:31.880

It's a cool trick. When you delve deeper into it, Windows has a lot of time- and sanity-saving tricks up its sleeve. – Hashim – 2017-09-03T21:35:33.747

1As helpful as that was, sadly it didn't solve my problem (also, shift+right click doesn't work seeing as right clicking on this file specifically crashes my windows).

I claimed ownership of the folder, but when trying to claim ownership of the file specifically it simply said "Path does not exist."

Even so, I tried using a few programs (including the one you mentioned) to delete it... none worked even still. – 7rystan – 2017-09-03T21:38:08.417

1@Hashim yes, I tend to use the "shift->right click in folder->open command prompt here" trick :D but I didn't know the one you mentioned – redbeam_ – 2017-09-03T21:38:08.583

1C:\Users\Trystan\Music\7rystan\WAV>takeown /f "C:\Users\Trystan\Music\7rystan\WAV\7rystan - Never Been To Me.wav" /r /d y && icacls "C:\Users\Trystan\Music\7rystan\WAV\7rystan - Never Been To Me.wav" /grant administrators:F /t ERROR: The specified path is not a valid directory path.

C:\Users\Trystan\Music\7rystan\WAV>takeown /f "C:\Users\Trystan\Music\7rystan\WAV" /r /d y && icacls "C:\Users\Trystan\Music\7rystan\WAV" /grant administrators:F /t

SUCCESS: The file (or folder): "C:\Users\Trystan\Music\7rystan\WAV" now owned by user "TRYSTAN\Trystan". – 7rystan – 2017-09-03T21:41:15.953

1SUCCESS: The file (or folder): "C:\Users\Trystan\Music\7rystan\WAV\7rystan - Never Been To Me.wav" now owned by user "TRYSTAN\Trystan". processed file: C:\Users\Trystan\Music\7rystan\WAV processed file: C:\Users\Trystan\Music\7rystan\WAV\7rystan - Never Been To Me.wav Successfully processed 2 files; Failed processing 0 files

C:\Users\Trystan\Music\7rystan\WAV>del "7rystan - Never Been To Me.wav" C:\Users\Trystan\Music\7rystan\WAV\7rystan - Never Been To Me.wav Access is denied. – 7rystan – 2017-09-03T21:41:21.040

@7rystan it really seems that you will have to use a Linux live CD to delete that file.

and if that doesn't work then I think reformatting will be the only option – redbeam_ – 2017-09-03T21:43:26.767

Very interesting. Try running the command again, but this time with PATH being the path to the folder containing the file rather than the file itself. Also you don't need to run the cd command, that was a mistake on my part. – Hashim – 2017-09-03T21:59:20.903

Okay so... I finally managed to delete it, and I'm not even sure why this worked, but it did. I'll post the answer in a second, right after I throw a party for this success. – 7rystan – 2017-09-03T22:08:26.410