Windows XP Issue: Cannot Delete File

CKTurbo128

Platinum Member
May 8, 2002
2,702
1
81
I have a bit annoying issue with Windows XP - Professional at the moment. Here is the situation:

I have several of my music folders stored under the typical "My Documents - My Music" folder. In each of my folders exist a JPEG picture of the album (front cover & back cover), as well as the music itself. At the moment, I am trying to delete some of my music folders. However, there are a couple of music folders that I cannot delete.
In each of these problem folders, the JPEG pictures will not delete. If you try to delete the file by right-clicking or using the "Del" key on the file, nothing happens (the prompt to send it to the Recycle Bin doesn't even appear). If you double-click on this file, a blank image appears (even though Windows Explorer shows it taking more than 100 KB space). When I try to delete the problem folder itself, Explorer complains, "Cannot delete THELEG~2.JPG. Cannot find the specified file. Make sure you specify the correct path and file name." Strange, since Explorer clearly lists that file in that folder, but the file is listed as "The Legend of Zelda - Ocarina of Time - The Original Soundtrack - Vol. II - The Lost Tracks [Front].jpg"
I did find something in common between all of the problem folders: all of the images that cannot be deleted are longer than 84 characters and Explorer will not allow me to create or rename a file longer than 84 characters, just only in those folders. This is very strange, because I have many other music folders with image files that are longer than 84 characters that can be deleted/relocated fine. I can also create/rename files much longer than 84 characters in the non-problem folders. I have another PC with XP that has all of the same content of music as this PC, but it does not have this issue.

I'm at a loss here. To sum it up, Windows Explorer shows the JPEG files there, but when I try to delete it, it does nothing. When I try to delete the folder containing the problem JPEG file itself, Explorer complains that it's not even there. Any help on how to resolve this issue would be helpful.

EDIT: This is a relatively new install of XP on this PC, completely up to date with the latest Microsoft patches. No registry hacks or any of the sort has been done.
 

Psych

Senior member
Feb 3, 2004
324
0
0
Reboot the computer and hold down F8 until the advanced startup options appear. Go to safe mode with command prompt. Use the command prompt to navigate to the folders using the CD [path] command. Then try to use the DEL command to get rid of the files.
 

MadRat

Lifer
Oct 14, 1999
12,014
321
126
XP has this nasty "lock" issue with their Shell32.DLL right now that should be fixed with SP2.

When Explorer browses the folder information to build its search index, each file is temporarily placed in a "lock" status as each metafile tag is read. Unfortunately you may have another application open that suddenly wants access to it. For some reason Shell32.DLL refuses to let go and it gets a "lock" status on it. Reboot and delete it before opening the application that uses the file. If that does not work then check the attributes on the file and make sure its not marked with an "S". To remove the "S" attribute just type:

attrib -S <location>\<filename>
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
sometimes just closing the browsing window and doing it from the command line works (as Psych kind of suggests, but try it with the regular commandline first)

Another solution I have been shown is to kill explorer.exe altogether. Do that with the task manager (then everything will also dissappear from your desktop, just like when explorer crashes on it's own). Then do File -> New Task -> Browse. Find the files, delete them, then restart explorer.exe from that New Task window.

hth
 

CKTurbo128

Platinum Member
May 8, 2002
2,702
1
81
Hmm, I have tried everyone's solutions, but they haven't worked. :( I think everyone is mistaking my problem with the common "Cannot delete file. Another application is using it" issue (even though there isn't). You see, Explorer doesn't even show any such errors, or prompts when I try to delete the problem file. Absolutely nothing happens. It is only when I try to delete the folder with the problem file, where it says "THELEG~1.jpg file does not exist. Check path" or the sort. I can't even check the file properties when I right-click the file. In fact, none of the typical file actions (Properties, Delete, Cut, Copy, Make Shortcut, etc.) show when I right-click the problem file. It's like the file isn't even there, or the it isn't even a file at all.

Also, does anyone have a clue why files in these folders with the problem file cannot be named longer than 84 characters? As far as I know, XP allows file lengths greater than that (my other music folders have JPG files with names longer than 84 and show no problems). This is the most unusual (and annoying) XP bug I have ever run into. :(
 

Kickback

Junior Member
May 15, 2004
1
0
0
You know, it's funny that you mentioned having this problem because i too, had the same problem trying to delete a folder that i moved from one drive to another drive. After i was able to burn the files to a cd, i went into the folder and deleted the files but when i tried to delete the folder, it said i couldn't because the folder was in use by another program or whatever... Anyway, i did a little research and found this handy little FREE program called, "Process Explorer." It can be downloaded at, http://www.sysinternals.com/ntw2k/freeware/procexp.shtml The version i got is 8.35 for windows XP. Anyhow, after i installed it, i went up to the menu and clicked on, "Find" then, "Find Handle..." then typed in the name of the folder or the path to that folder in the "Process Explorer Search window" and Wholla! it showed the folder name, along with it's path statement, in the lower window pane. The main window is divided into 2 windows. The upper window shows all of the tasks that are currently running on your system. The lower pane window shows all of the HANDLES for a given task that was highlighted in the upper window. When i typed in the folder name in the search window, it displayed the folder name in the Handles window pane. The upper TASK window was showing the Explorer.exe file as being the task that was keeping the folder "IN USE." So i right clicked my mouse on the handle and chose to close that handle. Of course, a warning message will pop up warning you that, "Forcing a handle closed can lead to an application crash and instability. Continue with close?" Of course i said and did it. Then i went to the drive where the folder was and deleted it AND THIS TIME IT WAS DELETED! YAHOOOOOOO. I think i'm gonna love this Process Explorer...:eek:)
 

biostud

Lifer
Feb 27, 2003
20,254
7,387
136
"del." in the commandprompt have worked for me. just remember to move the files you would like to keep before doing so :)