Tuesday, February 2, 2010

Deleting undeletable files manually using command prompt

In our earlier post, we have seen about deleting undeletable files using unlocker. That's a nifty tool for sure and is a must have for all computer users. But one friend of mine asked me if we could delete files manually without using any software. So just to share with those who don't know, I am putting up few lines on how to do it manually.

Warning: novice users may find this a bit complicated and if so stick to deleting undeletable files using unlocker. It's a free and small (about 250 kb only) software and should not be a trouble even for very new users. Just follow the guide on that post on on the official website and it will be a clean job.

Continuing with our post, we go ahead and see how to delete undeletable files manually using command prompt.

METHOD 1
The first way is to delete a file using command prompt (the normal way)
     *Suppose the file we want to delete is named 'undeletable file' and is located somewhere in our c drive, program files. Our first step is to navigate to that folder using command prompt.
     *To access the command prompt (for those who don't know, else skip to next procedure), press Win key + R to get the run command, or click on Start, then run and type 'cmd' or 'command' without the quotes. Vista users may use the Search box after clicking on Start.(click on the images to see them in their original size)
 
 
     *Once we get the command prompt, the next step is to go to the directory of the file we want to remove. In our case, we have a file in C:\Program Files\undeletable file.exe
     *To navigate to that place we type the following without the quotes.
--type 'cd\' . This command takes us to the root (beginning) of the current drive (we are in C drive initially)
--type 'cd program files'. cd stands for change directory. We are using it because we need to go into a directory/ folder name 'program files'. After typing this, we will be inside program files and command prompt will show as follows. C:\Program Files>
     *Now that we have come to our destination it is time to delete the file that we want to remove. To do this, you may additionally see if the file is present inside the current directory/folder. Do this by typing 'dir' and you can see your target file. This is not needed if you already know if the file is present inside that folder.
     *Now, to delete the file type
del "undeletable file.exe" or
del undele~1.exe

The file name is put inside the double quotes because it has multiple words with space in between. If we neglect the quotes then it will detect only undeletable and will show error since there's no file with that name. Another method is to append ~1 after the 1st six letters of the file name. Note that in case of a file name such as 'bat manager.exe' the word bat has only 3 letters, so in such cases we write it as 'batman~1.exe' (without the quotes) and our work will be. What we are doing here is that we are neglecting the space character. See the image below to understand clearly. Click on it to see the original image.
 
     *If all the procedures have been done properly then you will find that the undeletable file is now gone.
In most cases involving viruses, the files are locked into memory and are thus difficult to remove by the earlier method. Thus, if the above method has failed in removing your undeletable file then here is a method stronger than above.

METHOD 2
     *Press alt+ctrl+del  or ctrl+shift+esc together to access the task manager. Go to the Process tab, find EXPLORER.EXE, right click on it and select End Process.

     *After that the entire screen will go blank. Keep the task manager open.
     *Click on File(on the top) in the task manager and select New Task(Run).
     *Type cmd or command and follow the procedure given above in METHOD 1.
     *This time, the file must have been deleted.
     *Open task manager again, go to File, select New Task and type 'explorer' or 'explorer.exe' and click OK to get back the GUI Shell (your normal windows screen).
     *This method should remove most of the file but if it'a nasty case of virus infection then it may not. In that case follow this method in Safe Mode.

No comments:

Post a Comment

Please post your comments on whether you liked it and what else would you like me to write on. Suggestions of all types are welcome.