
They all fail with ERROR_INVALID_NAME (in the case of ZwCreateFile(), after using RtlNtStatusToDosError()).Even if I had a file with an invalid character in its name, I doubt DeleteFile() would be able to delete it. I tried CreateFileA(), CreateFileW(), and even ZwCreateFile() and none of them would let me create a file with an invalid character in its name. I tried a number of times with a variety of different invalid characters including U+0012, which appears to be the invalid character in your file's name. I can't be absolutely sure though, as I have been unable to create a file with an invalid character in its name.
NORTON DISK DOCTOR DOUBLE WINDOWS
So you might as well stop now because it doesn't look like the Win32 API will accept the invalid file name.I don't think you can delete a file with an invalid character in its name using the Win32 API, at least not in Windows 2000, which is the operating system under which I ran these tests. (duh View image: /infopop/emoticons/icon_smile.gif )Playing with the shell and various scripting languages are ultimately just different ways of passing the invalid file name to the Win32 API.

this should work much better and not require any tracing of the character ASCII code.Moonlit Knight Try using the tab-completion, and then edit the file name and preceed the weird character with a \ or enclose the entire name in back quotes.Or, you could try vbscript and use the chr function to generate the correct file name.something like:=option explicitdim fsoset fso = CreateObject ("scripting.filesystemobject")dim strFileNamedim iCounterdim strFileNamefor iCounter = 0 to 255 strFileName = "c program files\network ice\blackice\hosts\" & chr(ICounter) & "44E0D~1.txt" if fso.FileExists (strFileName) then fso.DeleteFile (strFileName) if err.Number = 0 then msgbox "File Deleted!", vbokonly + vbExclamation, "Success" end if exit for end ifnextset fso = nothing=I modified the script. this is typically a unix thing, but it might work in cmd. You can keep appending to a path and hitting tab, and it will continue to fill inc win* c winntc winnt\sys*32 c winnt\system32etc.Moonlit KnightĪnother thought. Hitting c doc* and hitting tab will result in "c documents and settings". It also quotes anything that needs it to. If you hit Shift-Tab, it will scroll backwards through the list. Everytime you hit Tab, whatever matches next is entered. Tab completion also respects wildcards, so typing in ?.txt and hitting tab will fill in text files with 3 characters in the name. Just hit tab to start filling in file names or directory names.

I've been able to get rid of some freaked out names before that way.If you don't have tab completion turned on, go toHKCU\Software\Microsoft\Command Processorand set CompletionChar to 9.Any new CMD instances will have then have tab completion turned on.

cd \directorytype in del *.txt and hit TAB, then hit enter. Others have said 'you're just not following the instructions', but the files won't budge, and no amount of tweaking helps.This thread has the information: my attempts to rid myself of the files, and suggestions from others.Excession. There was another thread on deleting files, and none of the solutions would work on MY problem files, because I got the error message that you're encountering.The way I resolved my problem was to get rid of all the files I could from the directory, and then RENAME the directory itself to 'badfiles' and MOVE the directory to the top level of my disk, then I could delete the subdirectories that were 'locked' due to undeletable files.I have six files on my disk, and I don't think I'll be able to get rid of them under Windows XP without hex-editing the disk itself. The files were created in a Eudora directory, and have CTRL-D's embedded in them.
