Why Can't I delete Minecraft Files? [duplicate]

Ok, so I wanted to download a mod. But the mod has nothing to do with the problem... Anyway, I went to delete the META-INF file in the Minecraft .jar (or Minecraft) and it did not delete, due to the file is being used by a program. I then tried to delete the Bin folder since that worked in the past with different problems. So I went to delete the BIN, and it said cannot delete, because Minecraft is being used in Java(tm)SE-BINARY. I opened Java and it closed instantly.

What can I do to get my mod on the game because the folder wont delete ANYTHING? Unless I can find out what program is currently using Minecraft?


Solution 1:

The easy way is to restart your computer and try again. If this doesn't work try to close all apps in Task Manager manually.

Solution 2:

Type this command into command prompt, this should fix your problem. You can launch command prompt by doing Start Menu -> Run, then type in CMD.

taskkill /f /im javaw.exe 

Once you do this you should be able to delete the file.

What this does is tell Windows you want to close the Java application that is currently using Minecraft. Once this happens it will free up the file and allow you to delete the file.

The other options is open up your task manager and if you see any instance of javaw.exe to end task the program.

Solution 3:

Exit ALL of Minecraft, and all Minecraft-related applications. If this doesn't work, delete each folder individually.