Cannot delete file or folder

Tue, 2007-07-17 11:46 by admin · Forum/category:

This article describes different methods to delete files or folders that cannot be deleted normally.

After trying the following methods, please click here to let us all know your results.

Table of contents

for this article

Reboot

Reboot, then delete.

DEL or RMDIR

Open a command line window (WindowsKey + R, enter: cmd). Move to the folder in question by means of CD commands like CD \ and CD foldername.

Delete the file or folder by using the DEL command to delete files or the RMDIR (remove directory) command to remove directories (folders).

Kill explorer.exe

If this, on its own, is still not enough, then leave the command line window on the desktop, open Task Manager (Ctrl + Shift + Esc), and kill all explorer.exe tasks. Your desktop will go blank, except for the windows already open.

Now try to delete the offending file by means of the DEL command, or folder by means of the RMDIR (remove directory) command, in the command line window, as described above.

After that, in the command line window enter:

explorer

to restart your desktop. If you closed the command line window, you can still restart explorer by opening the Task Manager by holding down the Ctrl and Shift keys and briefly pressing the Esc key. In Task Manager select Applications, New Task and enter: explorer

Log off

If the previous method fails, particularly with multimedia files, log off, then log on again, but do not select the file in Windows Explorer. The safest way is not to open Windows Explorer in the first place.

Then try the previous method again.

Reboot again

An even stronger measure would be to reboot, then try the previous methods again. This would work, for example, if a service has the file open.

Delete containing folder

[Thanks to John Barrington:] If you can't delete a problem file, try deleting the folder that contains the problem file. If this doesn't work, try this next item.

If the problem file and its folder, we'll call (A), is within another folder, we'll call (B), try to delete the folder (B) along with any troublesome contents.

Of course, you want to make sure, if you have any other important files or folders within either folder, that they are saved in another location first.

Use RMDIR on containing folder

Begin like the previous method, but try also

rmdir /s foldername

(replace foldernamewith the name of the folder to be deleted). This command should delete a folder with all its subfolders.

If the folder name contains one or more spaces, enclose it in quotes. Example:

rmdir /s "folder name"

Note that the abbreviated command rd can be used in place of rmdir.

Use short name

If the folder name contains strange characters, use a command line window again, but use the DIR /X command to find the short name (for example: PROGRA~1) and use the short name instead. The short name is DOS compatible and has no more than 8 characters for the main name, a period, then no more than 3 characters for the extension.

Retry the previous methods that use a command line window, but use the short name now.

Note: Sometimes an illegal file name can cause Windows Explorer to use nearly 100% of the CPU time.

[Thanks to astk1:] Sometimes the abbreviated name can have a number other than one and can have an extension. If the above does not work, proceed as follows.

  1. Open a command line window (Start, Run, type: cmd, press the return/enter key).
  2. Navigate to the folder using "cd .." and "cd pathname", where pathname is the name of the next subfolder you want to go into.
  3. Type dir /x to see the actual real short name of the subdirectory. Critically: This may include an extension, e.g. "ABDCEF~1.XYZ".
  4. Type "rmdir /s abcdef~1.xyz", replacing the example name abcdef~1.xyz with your actual folder name.

Safe mode

Boot into safe mode and try to delete the file or folder there.

Stop program

If you're trying to delete a program file, like one with the extension .exe, the cause could be that the program is currently running. Stop it, then delete the file.

If the program starts automatically, check the article Autorun causes on how to remove the start command. Do it, reboot, then delete the file.

Rename or move during next boot

If this also doesn't work, there is a way to rename or move a file or folder during the boot process. For this you need to use the registry editor REGEDIT.EXE. See the Registry warning for a general warning.

Create a multi-text value in

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\

named PendingFileRenameOperations of type REG_MULTI_SZ. In pre-XP Windows versions you have to use REGEDT32.EXE to create this value type.

The first line of each pair is the current file or folder path and name with \??\ in front of it.

The second line of each pair is the new file or folder path and name with !\??\ in front of it.

Example for one pair which moves the file mfc42.dll from the temp folder to the system32 folder and overwrites any existing file at the destination:

\??\C:\TEMP\mfc42.dll
!\??\C:\WINDOWS\system32\mfc42.dll

You can add as many pairs as you like. The move operation is performed directly after the next reboot. You can also give folder paths, so the folder will be renamed. But both paths have to be local.

There is a Windows API call for this, named MoveFileEx, and somebody in Germany has even written a utility named MoveEx for it. You can download it from http://wwwthep.physik.uni-mainz.de/~frink/nt.html. Use it if you need this function often. A Posix utility from a Windows Resource Kit named mv.exe also does it, just in case you still have the resource kit around.

Use another operating system

Boot into another operating system to delete the file from there. The other operating system can be, for example, another installation of Windows, BartPE, Knoppix, Ubuntu, or any operating system that can read the file system used (NTFS or FAT32).

Connect hard disk to other computer

Remove the hard disk from the computer and connect it to another computer. Delete the files or folders there.

Use unlock utility

If you cannot delete a file or folder because it is in use, you can use one of the mostly free utilities, such as Unlocker.

Internet Explorer 8 issues a warning when you open that page, but as far as I can tell (I checked the code of the page at least superficially in March 2010) that is a false alarm.

Shorten names

If the cause is that the path and file name is too long, first try to rename folders in the path with shorter names.

If that doesn't work, you can use the following method, reported 2007-05-17 by Mark Briody:

Open a command line window and use the subst command to create a virtual drive to the folder containing the long file name, e.g. (all in one line):

subst x: "C:\Documents and Settings\briodym\Favorites\Mark\Gadgets and Hardware\Hardware\Stores\eBuyer"

Then change to the virtual drive x:, and you should be able to delete, rename, and move files and folders.

Finally, to clean up, remove the subst again with:

subst x: /d

Deal with hidden or system files

[Thanks to warpcoil, who first described this method in a comment below]

This method deals with files that carry the hidden or system attribute. You can delete such files in Windows Explorer, if you set the folder options such that these files are shown in the first place, but the following method can delete them from a command line window.

Open a command line window and navigate to the offending folder by means of the cd command.

Show all files, using the attrib command. Note the attributes displayed as single letters on the left side of the listing:

Letter  Attribute
R Read-only
H Hidden
S System

Delete the offending files with the commands:

del /f /a:s

del /f /a:h

Replace with the name of the offending file or files. You can use wildcard characters. For example, the following command:

del abc*.* /f /a:h

would delete all files whose names begin with abc and which carry the hidden attribute, regardless of the system or read-only attributes.

When it works you get no response, but typing attrib again will show that the file has gone.

Access rights

aguggis wrote an excellent comment, outlining the following procedure for the common case that you do not have sufficient access rights to delete a folder or file. Thanks!

I was unable to access or delete a folder created by rsync on Windows XP, and none of the solutions proposed here worked. The simple but effective solution [meanwhile slightly enhanced] was the following:

  1. Right click on the problem folder --> Properties.
  2. Select the Security Tab. (See below for Windows XP Home.)
  3. If necessary, click on Advanced, Owner, and take ownership.
  4. Mark your username and authorize full control.
  5. Apply and OK.
  6. Now you can delete the folder without problems.

This procedure can be used to delete the System Volume Information folders that Windows creates automatically.

In Windows XP Home Edition there is no "Security" tab, but if you boot your computer into safe mode and log on as Administrator, you will get the "Security" tab. For some more details, please have a look at:

How to take ownership of a file or a folder in Windows XP

Results

After trying the above methods, please click here to let us all know your results.

can't delete folders

Wed, 2013-08-21 19:36 by sigrossman

OK, so this worked for me and maybe will work for you in Windows 7.

I had a bunch of folders with pictures that I wanted to delete and I clicked on the group and got the refusal message. So with the group still highlighted I right-clicked on them and selected properties, The general tab showed up and the "read only" tab was checked. Who knows why? Anyway I unchecked it and a window came up asking if I wanted to apply this to subfolders (there weren't any). I clicked that, clicked on the Apply button and the Properties window disappeared. The folders were still highlighted. I clicked on the keyboard Delete button and Voila! they were gone.

Now I don't know if this will eliminate all the command line stuff, but it's the easiest thing to do first.

Freeware with added function

Mon, 2011-03-07 21:15 by lang1952

I had the same problem when AVG identified but failed to remove 3 trojans from a protected directory, it did subsequently do so but only later while I was researching this problem.

I also have MALWAREBYTES an ad deleter and there is a useful option under tools, called FILE ASSASIN that allowed me to circumvent the protection completely and very effective it was.

It ran while I was still in normal, system admin, mode and deleted a vast directory, file by file, then the sub and main directories with no problems in 10 minutes.

This can be used by a novice user with no computer knowledge, so it could be a problem if they delete the system directory as there is no going back once it is running. Always take a backup first, to external media, removable drive is ideal, so that you can restore if needed.

Win7: Cannot delete folder

Thu, 2010-09-23 19:26 by markusjota

The only way that worked for me is this one:
Go to the Start icon, write "User account control settings", click on the corresponding text that appears. In my case, the ruler was on "Always notify". I put it on "Never notify", went to Explorer and at last was able to delete the folder without any problems. Then I went back and put the setting again on "Always notify".

Windows 7 Pro to Windows XP Pro

Wed, 2010-08-04 06:27 by Tech Exec

Hi All, Similar problems here. I have an old workhorse XP Pro workstation. Runs like a charm. I have four internal drives, one external "packaged" drive, and two 4-bay external drive enclosures. So this beast has a few terabytes of data under management. In respect to how these drives perform on the local XP Pro instance, things are great.

So... here's the issue. I have a Windows 7 Pro laptop. Brand new. I can map to nearly every drive in the XP tower and have total control over the drive as though it was connected to the laptop directly. BUT... with only one of the enclosures, ALL FOUR of the drives in that box are refusing any updates.Each of those four (and only those four) drives responds with the now infamous "Destination Folder Access Denied" dialog box.

I've granted every permission possible. I've tried taking ownership. I've tried moving the data, re-formatting, and replacing the data. Nothing works. To say the very least, this is aggravating. As noted, I can create/update/delete folders on all other drives on that XP box. Only the four drives in this other enclosure refuse to be manipulated in any way (cannot create/update/delete files or folders).

The box is a Mediasonic ProBox HF2-SU2S2 enclosure. No support received from vendor yet...

Any clues? I pray that you'll all have seen/heard/found/learned something that might help.

Share access rights

Wed, 2010-08-04 08:07 by admin

One of several possible causes is this. In Windows, any object shared on the network has two sets of access rights appliled to it, one for the objects (files, folders) themselves, and one for the share. Have you checked both?

cut / paste "too long" path or filenames to the root directory

Fri, 2010-07-16 15:15 by bjanko

Sometimes the long filename will prevent renaming files and folders on the "too long" path, preventing you from shortening the names. However, I have had near 100% success rate in doing a cut/paste on the offending files and/or folders, from their current location to the root level, (such as C:\). Once the items are right at the root level, simply hitting delete key brings up the recycle bin's "Are you sure?" prompt and you're home free.

Now, I said NEARLY 100% of the time. However, the few times I had trouble with this method, it was usually that I was overlooking that another process was still holding onto the files/folders. Killing the process and sometimes restarting explorer.exe would solve it.

Finally, if you have an obscene number of subfolders, it was often helpful to go to the lowest one, grab a parent folder 2 to 4 levels above it, then move that parent (with its children) even another 3 or 4 levels higher. Repeat that procedure a few times and you will have greatly reduced the the length of the entire path. And, finally, if the parent of that group of files was still being stubborn, the cut/paste to the drive's root resolved the issue.

It's simple and saves hours of time.

- Brian

subst also works

Fri, 2010-07-16 19:40 by admin

Thanks for the good hints!

You could try the subst method described in Shorten names. It should also work.

nothing worked so i set up new profile

Mon, 2010-02-15 22:42 by bedboundmonkey

I put the folder containing the file into the shared documents folder, set up a new profile and copied the folder onto the new profile desktop, then went back to my profile and deleted the new profile. that worked for me

You cannot delete a file or a folder

Sun, 2009-12-27 20:15 by Burn1

This worked for me

Map a drive to a folder in the structure of the path
Map a drive to a folder inside the structure of the path of the target file or folder. This method shortens the virtual path.

For example, suppose you have a path that is structured as follows:
\\ServerName\SubfolderName1\SubfolderName2\SubfolderName3\SubfolderName4\...
In this path, the total character count is over 255 characters. To short the length of this path, to 73 characters, map a drive to SubfolderName4.

Good idea

Sun, 2009-12-27 22:10 by admin

Thanks for this good solution for the long-path problem. Sounds simple, once it's explained.

Nothing worked but there is a very easy way!

Tue, 2009-11-03 14:10 by aguggis

I was unable to access or delete a folder created by rsync on Windows XP, and none of the solutions proposed here worked. The simple but effective solution was the following:
1. Right click on the problem folder --> Properties.
2. Select the Security Tab.
3. Mark your username and authorize full control.
4. Apply and Ok.
5. Now you can delete the folder without problems.

The first thing I did was

Mon, 2010-03-08 14:27 by Cindy62707

The first thing I did was make sure I was the owner and had full rights but that did not work either.

I did find a way to make it work. It was simple but a pain in the butt!

1. disable the UAC.
2. Reboot the computer.
3. Then you can delete the problem file.
4. Then re-enable the UAC and
5. reboot the computer again.

What a pain!

Thank you

Tue, 2009-11-03 18:11 by admin

I had missed that one, even though I have done this operation many times.

I have added your advice to the main article and activated a personal blog for you on this web site.

Cannot Delete folder/video

Wed, 2009-08-05 01:44 by acepilot1212

I have tried multiple ways to delete a video i have, but it always says i need to confirm the operation, so i do, then it says destination folder access denied. I tried taking ownership of the file, but it says unable to set new owned, access is denied. i tried using the command prompt also to delete it, but it's on my desktop and the command prompt can't seem to find my desktop. I can't move or even rename the file. Any suggestions?

Video file - several methods will work

Wed, 2009-08-05 06:42 by admin

I believe that the cause for this behavior is that Windows Explorer actually enrolls a codec to determine the file type or some such. (If anybody knows more about this, please reply.)

Now if anything goes wrong there, like a defective codec (and there are many) or a not perfectly encoded media file, the codec can crash and fail to release the file after opening it.

Several of the above methods should work. Try to avoid opening the folder, try to prevent that Windows looks at the file. For example, reboot, then delete the entire folder. You may have to move other files out first, but then you have to reboot to release the problem file.

But the most convenient method is still a tool like Unlocker, which essentially does all this behind the scenes and without you having to worry about anything.

I have seen Unlocker

Mon, 2010-03-08 14:31 by Cindy62707

I have seen Unlocker recommended several times but when I follow the links for this recommendation above and others it gives this warning message:

This website has been reported as unsafe
ccollomb.free.fr

We recommend that you do not continue to this website.
Go to my home page instead

This website has been reported to Microsoft for containing threats to your computer that might reveal personal or financial information.

Does anyone know why IE thinks the web site for Unlocker is a dangerous web site full of viruses, etc when so many people recommend it?

Thanks,

I believe it is safe

Mon, 2010-03-08 17:32 by admin

I just looked through the code of the web page http://ccollomb.free.fr/unlocker/ and could not find anything dangerous. The page does use several JavaScript functions, but I could not discern any danger.

Since Unlocker is a well-known program that can be downloaded from that page, the author would have to be crazy to let any virus ride piggyback on his good software.

If all else fails

Wed, 2009-07-29 03:59 by the_kut

How I got this forum is interesting: while trying to convert my C: drive from FAT32 to NTFS under Windows XP, I kept getting the error on one directory that there was not enough disk space for conversion (I had 100 GB free). On further analysis, I figured out that it was the usual Windows philosophy of providing a random error when they did not know what the problem was and that the real issue was that the directory had invalid entries (including multiple files with the same name).

I decided that I should try and delete this directory, but none of the following worked:
1. chkdsk /f (showed no bad sectors)
2. Regular Windows delete
3. Robocopy
4. The Path Too Long Utility
5. Boot with another operating system.

After a week of frustration, I realized that I could use my Acronis True Image software to take a image copy of the entire drive excluding the offensive directory and then restore the drive from this copy. It worked!

This requires buying Acronis and having an additional disk, but if you do not already have a utility like this for backups, then it is time to get one. Not only can you recover from a damaged drive, but you can also roll back changes, find files that you may have accidentally deleted or over-written.

Hope this helps.

BTW, the reason I was trying to convert the drive is because that is the only way to upgrade to Vista (and Windows 7) without having to wipe the disk, lose all settings and do a clean install. I love XP, but I am going to have to upgrade some time in my life.

Free copy of Acronis

Wed, 2009-09-16 16:37 by tblount

There is a free version of True Image but the version will only work when at least one drive is a WD drive or Segate

http://www.fatwallet.com/forums/free-stuff/952378.

Good info

Wed, 2009-07-29 08:33 by admin

Thanks a lot for this information.

Too bad that good old chkdsk is too stupid to catch this kind of error. Too bad also that we don't have some unlink utility that just removes the folder, no matter what. But that's how it is.

delete if that file or folder is restored from Image (Acronis)

Wed, 2009-07-01 15:21 by cnksoft

What if a file or file is restored from image after deleting a particular user account.
How to delete that file if a user account is deleted. ie., that file is copied from c:\documents settings folder to somewhere in D drive.

Embedded colon in file name

Sat, 2009-05-09 23:37 by escherplex

Amazing ...

On a WinXP/SP3/NTFS set up to dual boot with Ubuntu Debian Linux I had a problem with a .pdf which had a ':' embedded into the file name. None of the downloaded utilities worked nor did any of the command line scripts. But for the Gnome-GUI File manager, deleting the offending file was a non-event. What's amazing is that resorting to the use of another (free) OS was the simplest solution to correcting a rather difficult Windows problem. Just hope Win7 when it finally shows up isn't as buggy.

Yes,

Sun, 2009-05-10 05:42 by admin

another operating system sometimes comes handy. I also carry some kind of Linux boot disk, if only to use the Gnome Partition Manager.

Microsoft may not directly be faulted. They would probably say that it is impossible to create a file with a colon in its name with Windows itself, so it's not their problem. The underlying problem is that Windows does not defend itself against other faulty software.

Quick side note for dual-booters

Sun, 2009-05-10 12:38 by escherplex

Caveat: if you have or are considering a dual-boot environment be careful with Linux network security settings since the Gnome file manager is potentially a hackers dream. I have some OpenOffice .odt-s archived on WinXP in password protected WinZip files, the contents of which are readily accessible in Linux without knowing the password. This suggests that not only MS but other commercial utilities within Windows fail to insulate themselves from external interference.

Can't be

Sun, 2009-05-10 20:25 by admin

That doesn't fit my knowledge. ZIP files are encrypted and cannot be cracked, if the password is long enough.

I would recheck that carefully.

XP solution

Tue, 2009-02-03 17:49 by blahburto

Bring your DOS window up (Command Prompt - XP) and find the folder that the image is in.
If it's the only image in the folder, this is the best way to do it.
Use the command 'erase *.jpg' (if it's a JPG), which basically erases all JPG files in the folder that you're currently in
You can also use 'erase *.*' and than answer 'Yes' - it will delete all files in the folder

Has worked for every file I've had like that.
Hope this helps.

Java will allow you to delete the path.

Sun, 2009-01-25 19:53 by Jens Moller

If you know how to use Java....

I did this under Windows XP

Install a recent Java JDK (http://java.sun,com) . I used 1.6.0_11 (change this as needed)

I put my work files in C:/JavaStuff/DeleteTree, so all the instructions here assume you will do the same.

Create a Blackscreen batch file - DeleteTree.bat
----
@echo off
echo Using jdk Java 1.6 with xp

SET JAVA_HOME=C:\Program Files\Java\jdk1.6.0_11
SET PATH=C:\Program Files\Java\jdk1.6.0_11\bin;c:\JavaStuff;c:\JavaStuff;
SET CLASSPATH=%CLASSPATH%;.;c:\JavaStuff;c:\JavaStuff\DeleteTree;
SET CLASSPATH=%CLASSPATH%;c:\JavaStuff\DeleteTree\commons-io-1.4.jar;

c:
cd c:\JavaStuff\DeleteTree
c:\windows\system32\cmd.exe
----
NOTE: On some Windows platforms the last line will be
'c:\winnt\system32\cmd.exe'

Download and unzip Jakarta IO from http://commons.apache.org/io/ - I used V1.4

Copy the commons-io-1.4.jar file to c:\JavaStuff\DeleteTree\

---

The subdirectory I wanted to delete and everything in it was 'E:\xlook\ads-old'

It was created by an error in an Eclipse file I was trying (probably 100,000 or so subdirectories were created).

Change the Following Java file to use the file path you need to remove:
---

// DeleteTree.java

import java.io.*;
import java.util.*;
import org.apache.commons.io.FileUtils;

class DeleteTree{
public static void main(String args[]) {
try {
File rm = new File("E:/xlook/ads-old");
FileUtils.deleteDirectory(rm);
} catch (Exception e) {
e.printStackTrace();
}
}
}

----

Double click on the DeleteTree.bat file - this will give you a Blackscreen. if your Java is setup right, you will have access to a Java Compiler and the Java Run time.

Enter the following commands to compile and run the application:

C:\JavaStuff\DeleteTree>javac DeleteTree.java

C:\JavaStuff\DeleteTree>java DeleteTree

----

In my case, it took quite a while for the program to finish (6 minutes or so), it was a very deep tree.

You can use notepad for the editor. If you use the same setup I used, It should only take 15 minutes or so.

I did not allow you to pass in a path - I considered this a dangerous thing to do - that is why I force you to hard code the exact path name in.

This is all free.

Thank you very much for your post

Sat, 2009-10-10 15:36 by anonymous

Hello,

I faced this situation when using a weblogic library called from ant script, the library encountered error, and somehow ended up created a funny directory structure that I can not delete from Windows Explorer, or from command line using rmdir, even chkdsk can not fix, just about to give up and format the whole drive.

Thanks to your post, I follow your suggestion, create a simple java program, fixed this 'insanity'.

I think I learned a lesson today, thanks to you, if a file is created from java program, then use java program to remove it.

Again, thank you, and have a nice day :)

Best Regards

Thanks for the tool

Mon, 2009-01-26 07:41 by admin

How about polishing this tool, so it becomes very easy (one step) to use, and uploading it here?

A little problem is that Java is required, which is a bit heavy for those users who do not already have it installed, but for those like me who have the Java Runtime Engine installed anyway, it would be easy to use.

I used one tool at

Mon, 2009-01-19 10:49 by Perer Faulk

I used one tool at http://www.abtollc.com/Folder-Delete.aspx which has ability not only to delete files but also to copy it.

Thanks

Mon, 2009-01-19 17:17 by admin

Thanks for the link. However, that tool helps only in the one case where the path is too long. And it even costs money. And that problem can be solved quite easily by renaming a folder. Still, if somebody keeps having this particular problem, it could be useful.

Cannot delete folders, access denied

Sun, 2009-01-04 16:42 by MisterEd

I can't delete three folders.

Among the other folders the F:\ Partition has a folder with two subfolders:

4fbbc9a731b8358b44f945be7229ef02
-> amd64
-> i386

There owners are: "S-1-5-21-1606980848-1935655697-839522115-1003"

The properties of "4fbbc9a731b8358b44f945be7229ef02" show:
0 files, 2 folders, 0 bytes

With Windows Explorer I set:
[X] Show hidden files and folders
[ ] Hide protected operating system files

There appears to be nothing hidden
Also, if I try to acccess either "amd64" or "i386" I get "Access is denied"

I have tried to delete these folders using most of the mentioned methods with no luck
These include:
* rmdir and rmdir /s
* logging off and on
* rebooting
* Unlocker delete
* Unlocker delete on next boot
* Safe mode with command prompt
* Shortening the name of "4fbbc9a731b8358b44f945be7229ef02" to "4fbbc9"
* Changing the ownership of all three folders to my account (I am an administrator)

Access rights

Sun, 2009-01-04 22:56 by admin

Two things need to be done:

  1. Take ownership. You have already done that.
  2. Give yourself (or 'Administrators', if you are in that group) all access rights.

You need to do that for any content of the folders as well.

The folders have probably been moved from another computer, hence the strange owner, whose common name is not known on this computer. It would be easier, had they been copied, rather than moved, but it's still possible to give yourself access rights.

By the way, this same problem also occurs when you want to delete the System Volume Information folder (after disabling System Restore for the drive).

Did this work in your case?

When you said "Take

Thu, 2009-01-15 07:46 by MisterEd

When you said "Take ownership. You have already done that." that got me thinking. I had taken ownership of the top level folder only.

I went back and looked at the Change Owner in the security settings. There I verified that I was the owner of the top level directory. I then noticed something I missed before. At the bottom was a checkbox for "Replace owner on subcontainers and objects". After I checked that and clicked OK I went back to look at the folder again. Where before I was unable to even browse the subfolders I can now browse them. I am now finally able to delete these folders.

Thanks for your help.

Great

Thu, 2009-01-15 08:18 by admin

I did, vaguely, mention that the contents needs to be done ("You need to do that for any content of the folders as well."), but unfortunately I did not explicitly mention the little checkbox, although I use it all the time.

I had the same problem, I

Thu, 2008-08-28 08:37 by Jane Fox

I had the same problem, I studied the way of using all these commands for some time and then I bought File / Folder Clean-Up Tool(Long Path) at the address http://www.abtollc.com/products.aspx and cleaned everything i wanted to.

i3WM078's picture

None worked for me, however...

Tue, 2008-07-29 17:58 by i3WM078

I tried everything on the list to no avail. Still getting the same message:

"The process cannot access the file because it is being used by another process."

Anyway, to cut a long story short...

In a CMD window, I ran CHKDSK with /F /X switches.

CHKDSK forced my drive to dismount.

RD /S & the short name of my problem folder and my 3 problem .MP3 files are FINALLY gone.

Interesting!

Tue, 2008-07-29 21:13 by admin

It seems that you have found yet another reason why a file or folder cannot be deleted—a mangled file system.

Has anybody else seen this before? Please reply.

warpcoil's picture

Alternate method

Mon, 2008-06-16 20:48 by warpcoil

I had files on two systems that would not delete and caused backups and AV sweeps to fail; one was on the desktop and the other in the hidden directory folder structure c:\documents and settings\user\local settings\temporary internet files\... used for the IE cache.

This method worked for both, after all the above failed.

Open a CMD window and navigate to the folder, using "attrib *.*" to find the names of the hidden folders and files.
Once in the right folder type "del xxx*.* /f /ash" where xxx is the first characters of the file name sufficient to be unique compared with anything in the same folder you want to keep.

If/when it works you get no response but typing "attrib *.*" will show that the file has gone.

Good method!

Tue, 2008-06-17 06:17 by admin

Thanks for this method! The previous ones didn't contain any that deals with hidden or system files. I have appended this as a new method to the main article above. A few notes:

Instead of attrib *.* you can just use attrib alone.

You have to use both commands, one with /a:s and the other with /a:h, otherwise you will not delete files that have only one of the two attributes.

Methods 11 to 14 should also work on hidden and system files, but yours is simpler and faster.

Ubuntu to the rescue

Thu, 2008-05-22 00:39 by Packrat1947

Taking ownership can be done, but it's a complicated process. You could always download and burn a Ubuntu 7.10 bootable disc. You can even buy one for a dollar.

You'll boot into a Windows like enviroment. Go to Places (at the top of the screen), then open up your recalcitrant folder. Now you can delete, move, or do whatever you please with no permissions, or ownership issues.

One time in malware cleaning a customer's machine I had an undeleteable .dll file. This was the ONLY way to remove it. I tried Killbox, MoveOnBoot, and several other methods.

Packrat1947

Unbuntu

Tue, 2008-07-29 16:07 by jputter

I tried with success the Unbuntu 8.04 download. There is a down-loadable 695 MB operating system.It enabled the deletion of folders, which previously could not be removed in the Windows operating system, WinXPPro. These files were not only inaccessible, but prevented a Power Vault RD1000 backup system from working properly. Roxio installed Unbuntu on a CDRW. Then run the Unbuntu program, which offers the option of using the operating system as a demo directly from the CD without an installation or change to the computer settings. Once booted up into the Unbuntu operating system, go to "Places" in the top menu bar and delete any file or folder at will.Other methods to delete inaccessible files such as going into safe mode, truncating the size of folder names in the file pathway, or using remove directory commands in DOS, were not workable solutions.

Good solution

Thu, 2008-05-22 18:55 by admin

Thanks for this solution, which is essentially method 12 above, using a bootable Ubuntu CD. (Ubuntu is a popular Linux distribution.)

Excellent guide

Thu, 2008-05-01 04:11 by Tim 13

I just wanted to take the time out to thank everybody responsible for the creation of this guy. Via torrent sites, I downloaded an album tonight with a cross in the folder name: †

For whatever reason, explorer would shut down whenever I tried to delete these folders or change their names. At a loss for ideas, I showed up to this site, and tried a few of these suggestions. Using the command prompt, I managed to delete the folders that I had emptied out already, but there were even MORE problems after this. At least one of these album folders had folders inside of them which were TOTALLY invisible. Even the command prompt wouldn't find them. So, I used the "delete folder and subfolders," or rd /s, and that ensured that the problem folder was completely empty. From there, I managed to rd the folder itself from my desktop.

It was a war that I could have gone without fighting, but at least now, I'm richer for the experience, and I know how to handle it if I have any similar problems in the future. BAM!

Glad it helped

Thu, 2008-05-01 10:16 by admin

Isn't it strange that the operating system refuses to obey its master's command? Refusing to delete seems to be a particularly nasty transgression, in my personal view. But this web page should transfer the command back to the user. (:-)

"PLEASE FOR THE LOVE OF GOD

Wed, 2008-04-16 17:15 by Pangaea

"PLEASE FOR THE LOVE OF GOD SOMEONE HELP ME, PLEASE PLEASE PLEASE..
IM PREPARED TO PAY FOR THE HELP AT THIS STAGE.. PLEASE PLEASE PLEASE SOMEONE TAKE ME OUT OF THIS NIGHTMARISH HELL THATS BEING GOING ON FOR OVER 2 MONTHS NOW!!!!!! H E L P

2 months ago, i put a new hd into my pc... i slaved the old drive so the old drive is now D: ... by the way im running xp pro sp2.
I reinstalled windows onto the new drive C:
But the old drive D: still has the windows installed onto it.
There are 3 folders on the old drive i want to delete and send to the bottomless pits of hell..

Windows
Program Files
Documents and Settings

Windows REFUSES to delete these folders.. access denied ..etc

I AM logged into an admin account, so i should be able to delete these stupid folders.

I used third party things, like File Unlocker.. with no luck at all

I emailed mircosoft about 10 times regarding this,, either getting no replies, or useless replys... I physically wrote 2 letters to microsoft.. no reply... ive looked at 100`s upon 100`s of forums online, trying 100`s of different methods of deleting these folders... NO LUCK

this is now into the 2nd month of this nightmare. i cant work out how to do this, im angry, in particular with mircosoft, im fed up, and i dont know what to do short of formatting the drive (witch for other reasons is out of the question)

the last thing i tried was this (as directed by someone at mircosoft)
http://support.microsoft.com/kb/308421

sounds simple enough, tho.. if u read it carefully ull soon find out that the information there is not right....
meaning: they state on steps 2 and 3
2: 2. Click the Security tab, and then click OK on the Security message (if one appears).

3: 3. Click Advanced, and then click the Owner tab.

so first of all, step 2, "click OK on the Security message (if one appears)."
i have never never never seen a "security message" doing this in all my countless years using windows
secondly, stop 3, "Click Advanced, and then click the Owner tab." ...
..what the hell are you talking about mircosoft?? click on "advanced".. where the hell are you seeing these options? Owners tab?? are you on the same planet mircosoft?... Are you using some future version of windows as an example here???

PLEASE.. i need some help with this asap.. as im about to litterlaly chuck this pc out the dam window.

POST UPDATE ...... i gave my pc to a guy and payed him 80euro to try delete the folders..... he had no luck at all. tho he did manage to change the ownership of the offending folders to whatever account he was using... he said that after he did that (in safe mode)... he coulnt delete the folder what so ever.... same old story, access denied this, access denied that..

He also tryed taking the slave drive out, and putting it in a caddie, to try delete the folders on 3 different pcs, with 3 different operation systems... 98, 2000, vista ... he is baffled and understands wholly what ive been going thru this past 2 months.

if anyone has a step by step procedure on how to delete these folders or some software that wipes those particular areas of the harddrive please please please please let me know... please , im so begging you, and as i said early ill be prepared to pay some money toward your valued help.

Best Regards
Pangaea

Ps. sorry for the spelling and attitude, but as u now relies, after 2 months of this, im left very very angry and fed up with the whole thing... all i dam well want to do is delete 3 folders on MY OWN pc,.. how dam complicated must this be???"

Pss. The only thing ive managed to do is rename the folders using "unlocker"

Windows = delete me 1
Program Files = delete me 2
Documents and Settings = delete me 3

Hard drive storage 5 cents per GB

Wed, 2009-09-16 16:48 by tblount

Man... If I had the problems you have described before I went off the deep end trying to delete a file I would just buy another hard drive and back up everything else then format the bastard drive. I've seen 1 tb drives selling for $50 in the slickdeals.net discussioin formus ... that's 5 cents per gb.

Delet 3 folders from slave drive

Mon, 2008-09-15 23:01 by Steave_luice

Please my friend use the following way as a last option which must work in any condition.

FORMAT - try this way first.
1) Copy all you important data to master (new) disk from slave (old) by win explorer.
2) Go to my computer, right click your D drive which is old disk, and you will see the option in menu 'format'
click it.
3) copy all your data back from c drive to D now.

please let me know..

thanks

Mon, 2011-01-24 23:51 by gancha

I like your post

What happens when you try?

Thu, 2008-04-17 16:25 by admin

What's the exact error message you get when you try to delete these folders?

These three folders are exactly the ones that cannot be shared on Windows XP with Simple File Sharing enabled, like on XP Home.

My first guess is that you have no access rights to some folder or file in these three folders. The method to get around this is to take ownership of the folder first, then give yourself, or Everybody, full access rights. Then delete them.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.