This blog has moved!

You should be automatically redirected in 60 seconds. If not, click link below
http://mashtips.com
Please update your bookmarks.

Technical Tips: How to delete access denied files?

How to delete access denied files?

Typical Error Messages:

Cannot delete XXXXXXXXXX: Access is denied.
Make sure the disk is not full or write-protected and that the file is not currently in use.
The second of two typical Windows messages:
Cannot delete XXXXXXXXXX: It is being used by another person or program.
Close any programs that might be using the file and try again.
The typical DOS command line message:
The process cannot access the file because it is being used by another process.
Warning: Delete files off your computer at your own risk..some files mebbe used for OS..............

here s the solution...
first method:...

  1. If you already know the path to the file, skip to the seventh step.
  2. Click on Start, Search, All Files and Folders
  3. Type the name of the undeletable file in the box shown
  4. Make sure the Look In box shows the correct drive letter
  5. Click Search and let the computer find the file
  6. Once the file is located, right-click on it and choose properties, make a note of the file location. Usually this is something similar to 'C:\Windows\System32\undeletablefilesname.exe'
  7. Close the search box
  8. Click on Start, Run, and type CMD and Press Enter to open a Command Prompt window
  9. Leave the Command Prompt window open, but proceed to close all other open programs
  10. Click on Start, Run and type TASKMGR.EXE and press Enter to start Task Manager
  11. Click on the Processes tab, click on the process named Explorer.exe and click on End Process.
  12. Minimize Task Manager but leave it open
  13. Go back to the Command Prompt window and change to the directory where the file is located. To do this, use the CD command. You can follow the example.
    • Example: to change to the Windows\System32 directory you would enter this command and Press Enter, 'cd \windows\system32'.
    • Use the DEL command to delete the offending file. Type DEL where is the file you wish to delete. Example: del undeletable.exe
    • Use ALT-TAB to go back to Task Manager
    • In Task Manager, click File, New Task and enter EXPLORER.EXE to restart the Windows shell.
    • Close Task Manager.

Method 2

Undeletable files are usually locked because a program is in use. Before you can safely delete the file, you will need to unlock it. To do this, you can try rebooting the computer, or you can download Unlocker for free. This software will allow you to simply right click on the folder or file and then unlock the desired folders or files.
Note: Locked files indicate that a program is using the file. Unlocking a file in use may cause computer instability or loss of data. The safest way to attempt to unlock a file is to reboot the computer.


Other methods...

End the Locking Process
This is our first suggestion as typically files can not be deleted because they are in use. Usually the reason the file is in use is because it is a part of a program (or locked by a program) that is running. Sometimes the program that is running is a piece of spyware that you want to get rid of. The first step is to shut down this spyware program that is running. Skip by this, if this is not the case.
Press Ctrl-Alt-Delete to bring up Windows Task Manager. Go to the Processes tab. Search for the processes that should not be running. (We can not give advice on which processes these are. We hold no responsibility if you accidentally delete something you should not have. Please proceed at your own risk... This document is on how to delete the file, not how to determine which process is which software!)
Sometimes the names of spyware are easy to find, but sometimes they are cryptic or randomized on purpose. If in doubt, research the file on Google, like this one:
msbb.exe - Google Search (searching msbb.exe in Google quickly shows it is unwanted spyware)
Once you delete the process, you can (sometimes) delete the files associated with the process.

Shut Down "explorer.exe" and use DOS (same as first method..detailed explanation)
If that doesn't work, sometimes the file is locked by "explorer.exe" itself, which is Explorer. Explorer is not Internet Explorer. Explorer is the Windows graphical user interface. If you shut it down, you will lose things such as your Start menu, your taskbar, etc. Shutting it down will not damage your system, as explorer.exe can be thought of as just another program that is running.
Now, use Windows Task Manager to shut down "explorer.exe". Don't worry, Windows will not crash. You will be limited in what you can do for the time being, but Windows Task Manager can bring Explorer back up.
Now, after you have shut down "explorer.exe", go to "File" and "New Task (Run...)" in Windows Task Manager. Now, type in "cmd" and press enter.
Now you are in a DOS Prompt console program. From here, you can delete files without using Windows Explorer and other programs that require explorer.exe to be running. If you remember, it was probably explorer.exe that is "using" the file you want to delete, and thus blocking you from doing so... this solution allows you to shut down Explorer, and thus remove the "in use" property of the file, allowing you to delete it.
To navigate around your computer in DOS (Windows Task Manager, "File", "New Task (Run...)", type "cmd", and press enter), use the following commands:
cd \ ________________________ go to drive root
cd FOLDER_NAME_HERE _________ go into folder
cd .. _______________________ go up to parent folder (designated by two periods "..")
cd c: _______________________ go to specified drive
Play around with these commands and get comfortable with them. It is the only way you will learn.
To delete the files, use the following commands:
del FILE_NAME_HERE __________ deletes specified file
del *.* _____________________ deletes all files in current folder
To delete folders (directories), use the following commands:
rd FOLDER_NAME_HERE _________ removes (deletes) folder if empty (contains no files)
Once you have removed the files and folders, go back to Windows Task Manager and run "explorer.exe" to bring back Explorer. Go to "File" and "New Task (Run...)" in Windows Task Manager and type in "explorer.exe" It's that easy!


Delete the file or folder using the DOS names:
Sometimes a file is stored with a name that is invalid to Windows. I had a file that ended with two periods and Windows could not access it. I had to find out what the underlying DOS name was, and delete it in DOS using the DOS name.
Use the following command to show the DOS names of your files and folders:
dir *.* /x __________________ lists files and folders in DOS name format
Output from this command shows that "Favorites" is stored as "FAVORI~1" in DOS. You can access files and folders with Windows-invalid names by using the DOS name instead of the Windows name.

Delete File Before Locking Process Starts Via Batch File
If you can not shut down the process that is locking the file you want to delete, here is a method of deleting the file before the process gets a chance to lock it. As I have no idea what process and what file you are trying to delete, you may follow these directions at your own risk..
For the purpose of this tutorial, I will assume that the file you want to delete is "toolbar.dll" and it is located at "C:\Program Files\Toolbar". In other words, I will show you how to delete "C:\Program Files\Toolbar\toolbar.dll".
  • Create a new text file on your "Desktop" (right-click "Desktop", "New", "Text Document")
  • Rename "New Text Document.txt" to "delete.bat"
The extension ".bat" determines batch files. A batch file is a list of DOS commands that are executed when the batch file is executed.
  • Edit the batch file (right-click "delete.bat", "Edit")
  • Insert these lines (make sure to include the quotes):
REM Delete Batch File
del "C:\Program Files\Toolbar\toolbar.dll"
pause

The "del" command is the deletion command. The "pause" command pauses so that you can see what happens before the batch file window closes. The quotations are used as "Program Files" contains a space that will be misinterpreted as two separate words without the quotations. You may use any DOS commands in this batch file. You can see the commands I have chosen are to delete "C:\Program Files\Toolbar\toolbar.dll". Pay attention to what you try to do. "rd" cannot remove directories that are not empty, for example.
  • The icon of the file should change to reflect that the extension has been changed from ".txt" to ".bat".
  • Execute the batch file now (double click it)
Check to see if "C:\Program Files\Toolbar\toolbar.dll" is deleted. It should still exist as the process should still be locked. If the file is deleted, then you could have deleted it without using a batch file. To be explicit, a batch file does not posses special powers to delete files that you do not have yourself. A batch file can be executed at a time when the file-locking process is not running. This is the purpose of using a batch file.
Why execute the batch file now, when it doesn't work? Executing the batch file now lets you see what the batch file looks like when it runs, so it does not confuse you in the future.
As it says, press any key to continue. The batch file will then stop running and close down.
Now, let's run this batch file when the process is, hopefully, not running...
  • Explore "Startup" ("Start Menu", "Programs", Startup", right-click on Startup, Explore.)
A Windows Explorer window should open up that is exploring "C:\Documents and Settings\USERNAME\Start Menu\Programs\Startup".
  • Copy "delete.bat", the file itself (right-click "delete.bat", "Copy")
  • Paste "delete.bat", the file itself, into "Startup" (right-click in the "Startup" directory where the files go, "Paste".)
You should see "delete.bat" existing in your "Startup" directory. Now your batch file will run "on startup", when your computer 'starts up' from being shut off or rebooted. Hopefully it will run before the process that locks the file runs.
  • Reboot your computer and go see if the file gets deleted.
This is when you can tell if it worked or not.
  • "C:\Program Files\Toolbar\toolbar.dll", or whatever file you choose to delete, should be deleted.
  • Delete "delete.bat" out of "Startup".
Done!

Infinite Loop Batch File

Robert Melenyk suggested another idea which worked for him. The files he wanted to delete contained the process executable file itself! Even if that's not your case, it may be a worth while method to attempt on your stubborn, undeletable files. Here's Robert's tip:
Boot into safe mode (press F8 on reboot) and create an infinite loop batch file. (We will use "C:\Program Files\Toolbar\toolbar.dll" as the example file again.) Here is the batch file code:
REM Infinite Loop Delete Batch File
:loop
del "C:\Program Files\Toolbar\toolbar.dll"
goto loop
Change the center line to delete what needs to be deleted on your system. Then, run the batch file and end the process that is locking the file(s) in question. The file(s) should get deleted!


Programs to automatically delete a file


Remove on Reboot Shell Extension
This is a nice extension that loads into the right click menu. All you have to do is right-click on a file and choose "Remove on Next Reboot" and the file will be deleted the next time the computer restarts. Although it probably should only be used by more advanced computer users since it may be TOO easy to delete files using this program.


Pocket Killbox
A simple .exe file that you can use to delete undeleteable files, although the program will also delete temporary files, edit the HOSTS file, and more. A definite must have program when you are fighting an annoying spyware or adware program that won't remove.


Unlocker
Unlocker is another program that runs from the right click menu. Its simple and very effective. The website even has a side by side comparision of other programs that accomplish this task.

No comments: