Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid or illegal filename

Status
Not open for further replies.
Jul 21, 2005
87
US
We have a file on an XP system that has an invalid filename, and thus we can't delete it.

Background and more detail:

We had a virus, got rid of the virus (mostly), but there was a folder in our TEMP folder that we couldn't delete, although it appeared to be empty. We ran chkdsk, and lots of spyware/virus stuff, but we still couldn't delete the folder, even though it appeared to be empty.

We downloaded a program called Delete FXP Files from JRTwine Software that should've been able to delete this folder, but it couldn't... but the error message it gave us is probably the clue to our problem:

The error message it gave us is:

Failed to Delete "C:\unabletodelete\AAWTMP\C226750\junk\": 145 (The directory is not empty.)

(Ignore the pathname... that's a result of us trying to move that folder around in some way to be able to delete it.

What's important is the apparent filename... ": 145 or ": something....

How can we "get to" that file to be able to delete it? Is there a utility or command that would allow us to delete a file (that we can't even see) that has a bogus ffilename?

(We have full permissions to this folder.)
 
From what you've written, I would guess that you have already tried variations of this, but I'll throw it out there anyway. With the problem folder nested insided 2 empty folders, try this command line delete inside the top level del /f /s /q *.*

When run inside Top Folder
hopefullly it will |-Empty Folder
delete everything below |-Problem folder
 

Or you can just log in as a administrator in Safe Mode.
Enable viewing of "Hodden Files and Folders" from the Tools menu in Your Computer. And then just delete.
If it is still impossible to delete it, then delete first the Subfolders working your way out to the main folder.
Another way is by first deleting the registry entry for that file by locating it in you registry editor and just erase the REG_DWORD value. Then the delete will be possible.
Good Luck Nekko

 
Can't delete files w/ invalid names
thread779-1080580

Bogey file of zero bytes
thread779-852492
 
Ofcourse that is what they would say?
Tips from Microsoft rarely advise on deleting or editing keys in the registry?
This is stuff they don't mention because they do not want to incourage beginners to alter the registry.
Me, I just took for granted that there is a higher level of PC users in this forum. Especially those describeing themselves as "TechnicalUsers".
But believe me, I have deleted "invalid name" files a thousand times by altering the it's key entry in the registry editor and without using any special software.
Files w/ invalid names occur quite often these days, either due to viruses or as I many times experienced when downloading stuff through DC clients ( mostly those connected to East European countries).
Try it and you will see. I can upload a bogus file to a server if you want to test the way I suggested.

"The simplest solution is usually the right one"
Albert Einstein


 
Thanks, all, for those suggestions... I've tried all that, and still no joy.

Here's a question, and excuse me for my ignorance.... when I use regedit to try to find the file (or any file/folder) for that matter, it tells me "key not found." I must be doing something wrong in trying to search for that file. Little help?
 
Open regedit and go to the location where the file is supposed to be.
For example:
HKEY_CURRENT_USER\Control Panel\Desktop and check the entries to the right.

Look even under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows.
Open and check all strings.
Remember that Search will not work when looking for a non existing file.
Nekko
 
Thanks, Nekko... but I've got to admit I'm still having trouble finding ANY files in the registry... for example, if go into REGEDIT and do a Find for autoexec.bat, I get no results.
 
Did you try the suggestions provided by electronicsfreak, smah and linney? Are you still having problems? If so, please let the forum know what, if any, error dialogs you saw.
 
Most of the files on your computer will not be found in the registry, barring registered dll's, ocx's, and the like.
I have no idea what he's talking about, deleting files from inside the registry.
HKLM\software\ is not a map of the files on your drive or something.

The way I delete said files is to go to that directory, and do a "dir /x". Then it will list the DOS 8.3 filename.
then delete with the syntax:
"del \\.\c:\pathto\filena~1.xxx"
You can also try using ?'s in place of the invalid characters.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top