6

I'm aware of similar posts on this, but they haven't fixed my issue. I have an .iso installation file previously mounted with MagicDisc that I am now unable to delete. I have of course unmounted the file and shut down MagicDisc. I've also rebooted in safe mode, tried deleting with Administrator privileges, tried deleting by command line, and nothing works. Very grateful for suggestions on how to retire this resilient file.

In Explorer the error message is:

enter image description here

By command line the error is:

PS C:\users\Robin\Downloads> del .\ArcGIS_Desktop_101_129026.iso
del : Cannot remove item C:\users\Robin\Downloads\ArcGIS_Desktop_101_129026.iso: The process cannot access the file
'C:\users\Robin\Downloads\ArcGIS_Desktop_101_129026.iso' because it is being used by another process.
At line:1 char:1
+ del .\ArcGIS_Desktop_101_129026.iso
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\users\Robin\..._101_129026.iso:FileInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand
PS C:\users\Robin\Downloads> del *.iso
del : Cannot remove item C:\users\Robin\Downloads\ArcGIS_Desktop_101_129026.iso: The process cannot access the file
'C:\users\Robin\Downloads\ArcGIS_Desktop_101_129026.iso' because it is being used by another process.
At line:1 char:1
+ del *.iso
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\users\Robin\..._101_129026.iso:FileInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand
PS C:\users\Robin\Downloads>

Appendum

enter image description here

geotheory
  • 1,069
  • 3
  • 14
  • 28
  • try searching for the file in Process Explorer and see what process has it locked. if its not a system process you may be able to kill it, delete the file, and reboot. – Frank Thomas Sep 24 '13 at 14:12
  • I assume you mean in Task Manager. I'm not sure how to identify which process is using the file. The `iso` doesn't appear itself anywhere (even with `Show processes from all users` ticked and `System` processes being visible. – geotheory Sep 24 '13 at 14:22
  • Process Explorer is a Technet (formerly SysInternals) tool that gives you advanced info on the running processes, and a nice informative GUI. Mark Brak provided a download link below. Another option is a peice of software called Unlocker. I haven't used it in years, but its been very useful for exactly the kind of issue you a re experiencing. – Frank Thomas Sep 24 '13 at 14:25
  • Out of all the answers on the "similar posts" you went through, exactly what did you try already? – Ƭᴇcʜιᴇ007 Sep 24 '13 at 14:28
  • possible duplicate of [How do I delete a 'locked' file?](http://superuser.com/questions/13291/how-do-i-delete-a-locked-file), http://superuser.com/questions/73255/windows-7-file-in-use-when-deleting-file?rq=1, http://superuser.com/questions/13291/how-do-i-delete-a-locked-file?lq=1, http://superuser.com/questions/305541/windows-7-can-not-delete-a-file-file-in-use?lq=1, http://superuser.com/questions/51608/how-do-i-delete-a-file-that-is-in-use-by-another-process?lq=1 – Ƭᴇcʜιᴇ007 Sep 24 '13 at 14:29
  • The one linked above and [this](http://superuser.com/questions/323146/problem-deleting-files-in-windows-7). The others seem not to apply for one reason or another. The preferable solution would be to kill the process using it. – geotheory Sep 24 '13 at 14:38
  • That's a bit lazy @techie007. It can't be a duplicate of all of these. So make your case against a specific one, and if it is I'll close the question. – geotheory Sep 24 '13 at 14:40
  • The first one is what I chose to mark it as a duplicate of, the others are related/dupes for your reference. Sorry if you think that's being "lazy". – Ƭᴇcʜιᴇ007 Sep 24 '13 at 14:44
  • 2
    @geotheory - This problem isn't unique to a specific version of Windows. Besides you don't get to decide if its a duplicate the community does. Have you used Process Explorer to determine what process is preventing you from removing the file? I see no mention of you using any tools in you question, responses to comments might, but the question should have the information also. – Ramhound Sep 24 '13 at 14:53
  • As I asked back a while ago, explain exactly what you've tried already, and what your results were. So far, all the answers given here are in the (various) questions marked as possible duplicates; if you can show us that nothing else in those dupes covers your situation then it might be worth leaving open. – Ƭᴇcʜιᴇ007 Sep 24 '13 at 15:04
  • @Ramhound point taken about community decision. But despite this not being unique, it seems to me a bit unreasonable to expect everyone to assume that's the case. techie007 please be my guest and vote to close it. – geotheory Sep 24 '13 at 15:05
  • @techie007 just to note I've established that your suggested original answer (Process Explorer) fails in my case, so this cannot duplicate that question.. – geotheory Sep 24 '13 at 15:38
  • I wasn't suggesting any specific answer, I was pointing out the _question_ is a dupe. Also, there's more than one answer to those questions. :) Anyhow, glad you got your problem sorted. – Ƭᴇcʜιᴇ007 Sep 24 '13 at 17:00
  • Just FYI, we close questions as duplicates in order to point people to an answer. Not necessarily because they're absolutely the same questions. Since Unlocker solved it for you, and it's mentioned all over the place, I think we can safely close this… – slhck Sep 24 '13 at 18:45
  • Then you perhaps may want to flag up there about the additional [spy/bloatware](http://forums.anvisoft.com/viewtopic-45-3840-0.html) issue with Unlocker. – geotheory Sep 25 '13 at 09:32

4 Answers4

5

Since the file is in use by the system process (ID=4), you cannot kill it to free the lock.

Boot from a live CD of your choice (ubuntu for instance), and mount your hard disk. delete the file, and reboot into windows.

Frank Thomas
  • 35,097
  • 3
  • 77
  • 98
4

In the past I've used Process Explorer to find the handle that is preventing a delete. Download it here: http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

Open it up and hit "Find" and then "Find Handle or DLL"

You can probably just type iso in the search box. If it finds a program using the iso highlight it and then you'll see it appear in the main window on the lower section. From there just right click the handle and choose close. Worked for me in the past so hopefully it helps you.

Cheers!

mark brak
  • 134
  • 1
  • `0 matching items` sorry @mark-brak no luck with this method (although the software does look handy) – geotheory Sep 24 '13 at 14:29
  • 1
    @geotheory: did you run process explorer as admin, and confirm that its showing processes from all users? – Frank Thomas Sep 24 '13 at 14:40
  • Actually as admin it does find the file (see appendum image above). But killing the process still fails (same error message), and right-clicking the file in the window below and choosing `Close Handle` returns the error `Error opening process: the handle is invalid`. Any further suggestions? – geotheory Sep 24 '13 at 14:59
  • 1
    If you pop in your Windows 7 disc you can boot into the repair menu and delete the file from the command prompt. Here is a step by step to boot to this menu. The command prompt part finally appears in step 7. This will save you from having to download a linux boot cd. http://pcsupport.about.com/od/toolsofthetrade/ss/windows-7-startup-repair.htm – mark brak Sep 24 '13 at 15:51
3

For files that are locked by another open process, I had most success using Unlocker.

Just be careful when installing it, because the developer chose to add a toolbar installation to the install process. Just select "Advanced" in the installation and uncheck all the options.

After installed, just right-click the file and select "Unlocker". You'll see all the process current using the file. All you have to do is select the "Erase" option in the selection box and click "Unlock All".

Rik
  • 13,159
  • 1
  • 34
  • 41
  • Your link is a 404 – geotheory Sep 24 '13 at 16:05
  • I did in the end use this solution, but I didn't get an option to not install the toolbar stuff, and I have ended up with spyware attack. Nevertheless it has removed the file. – geotheory Sep 24 '13 at 16:08
  • @geotheory - I don't believe the real Unlocker file has spyware connected to it. Where did you download it from exactly? – Ramhound Sep 24 '13 at 18:29
  • I'm really sorry to hear that, I should not have recommended any software that contains Malware in the installation. I did however uninstall and reinstall Unlocker just to make sure there was a way to not install the toolbar, it was on the third page of the installation. I suppose I'll not be recommending it anymore. I've been using it for years, but just recently noticed they added the toolbar install. I'll install the toolbar on a VM machine and see if i can find a good tutorial to remove it. – JoselitoBanzai Sep 24 '13 at 21:59
  • Now not sure where, probably the same place as [this chap](http://productforums.google.com/forum/#!topic/chrome/mRJY17behbk%5B1-25-true%5D) because I got the same 'Delta' software. Subsequent virus check then found 3 spyware files, although I guess strictly speaking I've now deleted any evidence of their origin. – geotheory Sep 25 '13 at 09:26
  • The process outlined by 'gringo_pr' [here](http://www.bleepingcomputer.com/forums/t/485133/infected-with-delta-search-hijacker/) seems to have done a pretty good job of cleaning my system. – geotheory Sep 25 '13 at 10:02
  • That link, generated the following message from Bitdefender : Reported Unwanted Software Page! **This web page at www.emptyloop.com has been reported to contain unwanted software and has been blocked based on your security preferences. Unwanted software pages try to install software that can be deceptive and affect your system in unexpected ways.** – user10089632 Sep 11 '17 at 22:37
3

This process is being run under system process. What you can do is use psexec from: http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx

Then start cmd under system account: psexec -i -s cmd

After that you can use interactive cmd shell to kill the process that is having a lock on the file: taskkill /PID 4, if this fails you can try adding /F (force) switch.

And you delete the file: del /F .\ArcGIS_Desktop_101_129026.iso

This is a "brute force" method so hopefully you know what you are doing.

Damir
  • 141
  • 1
  • 3
  • Already fixed now, but this looks handy in future. Much preferable to installing software solutions - unlike the spyware that has just infected my system :( – geotheory Sep 24 '13 at 16:05
  • Still says "Access is denied" for me :( – fig Sep 06 '17 at 11:20
  • 1
    Interesting ideas, but System process cannot be killed, and psexec under System still could not delete the file... – Jason Jan 29 '19 at 19:19