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

  • 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
  • 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
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".

  • 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 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 9:26
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.

  • This seems like the best option. – Ramhound Sep 24 '13 at 15:25
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!

  • 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. pcsupport.about.com/od/toolsofthetrade/ss/… – mark brak Sep 24 '13 at 15:51
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.

  • 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 6 '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

Not the answer you're looking for? Browse other questions tagged or ask your own question.