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,099

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
  • 37,476
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
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,565
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
  • 151