Deleting Corrupted Files

A

Allen Heim

I have a number of files on my Windows 2000 server that I
cannot delete. Some of them have names with strange
characters and some do not. This stems from a problem we
had about a year ago when our RAID controller went down.
We were able to reinstall the operating system on the C:
drive and recover the data from the D: and E: drives;
however, there were some files that were corrupted and I
am unable to erase them. I have tried running chkdsk /f
and that has not eliminated the files. I have also tried
to delete the files from the command prompt, but was
unsuccessful. One of the file names is 113?1D2?|wd.
Another file contains characters that don’t even exist on
the keyboard. How can I erase them?
 
N

Ndi

You know, Google is a great tool.

Use the command prompt to browse to the files, then use DIR /X to get the
short file names and delete calling those names (e.g Window~1).
 
M

M Mullen

On Thu, 16 Oct 2003 00:18:49 +0300, "Ndi" <Ndi_at_Ndi_dot_ro> wrote:

|> You know, Google is a great tool.

Been there done that..

|> Use the command prompt to browse to the files, then use DIR /X to get the
|> short file names and delete calling those names (e.g Window~1).

Read it before, even tried it.

I have two files I have pretty much accepted as permanent at least until I
reformat.
one is:
nC(??+??.-?-
the other:
+??s)++?.?M$
Lower ascii just doesn't do them justice, the names actually show up as squares.
Even my news reader (Agent) is complaining about them <grin>not sure how they
will look when sent.
They are both 32k files, I figure it's something that chkdsk did somehow. Any
time chkdsk saves anything it's 32k, it could also explain why no 8.3 file names
are associated with them.

a ps is required here: there is an old Dos program that I used ages ago to
remove files with bad names. but I didn't want to screw with the long file name
structure; just wasn't that important.


o _ _ _
_o /\_ _ \\o (_)\__/o (_)
_< \_ _>(_) (_)/<_ \_| \ _|/' \/
(_)>(_) (_) (_) (_) (_)' _\o_
"Winxx - "Where do you want to crash today?"
 
N

Ndi

They are both 32k files, I figure it's something that chkdsk did somehow.
Any
time chkdsk saves anything it's 32k, it could also explain why no 8.3 file names
are associated with them.

Unless you disabled short file name generation, you should have a short
name, regardless. If they are in the valid ascii-8 range and name is shorter
than 8+3, system does not generare a short name (catually it's blank)
because the file name IS short.

Did you disabled the short file name generation?
a ps is required here: there is an old Dos program that I used ages ago to
remove files with bad names. but I didn't want to screw with the long file name
structure; just wasn't that important.

That seems too radical. Anyhow, should I understand that you don't have
the files any more?
 
G

Greenseed

maybe you can try in cmd type dir /x to see the 8.3 file name format
and use erase command like erase "name of file with a ~" ... or try a
soft called CIA commander.. it can acces NTFS volume in shell only...
or maybe if you can't delete it because it use try with you cd of
win2k ".../i386/winnt32.exe /cmdcon" it will install commande prompt!

Greenseed
 
M

M Mullen

On Sun, 19 Oct 2003 02:57:03 +0300, "Ndi" <Ndi_at_Ndi_dot_ro> wrote:(cc sent
E-mail to author)

|> Did you disabled the short file name generation?
|>
Nope, everything else under dos shows the 8.3 file names with the /x switch

|> That seems too radical. Anyhow, should I understand that you don't have
|> the files any more?

Oh ya there still here, fact is I have a rock solid path due to them:
C:\Documents and Settings\All Users\Documents
can't delete it, rename it, move it. and I'm darn sure not going to attempt to
copy it, it just might work ;)
The files don't cause any problems and CHKDSK just ignores them (a creator
attitude ?).

* o/ o__ / __ __ \ | o/ *
* __| \/ \__o /\o |o /\ __| o\ / |__ *
* | | | \ \ | |o /o | | | *
STICK \'stik\ n. A boomerang that doesn't work.
 
N

Ndi

Nope, everything else under dos shows the 8.3 file names with the /x
switch

That can mean 2 things:

a) it IS short
b) POSIX?

If it really IS short there might be some sort of translation error,
still, it SHOULD delete unless you copy/paste the name. And Explorer
doesn't.

If it's POSIX ... well, I admit I tried to write you a helper app but
cought my eyeballs somewhere on the way. I think I can make it grow, but I
guess that isn't your best wish :)
Oh ya there still here, fact is I have a rock solid path due to them:
C:\Documents and Settings\All Users\Documents
can't delete it, rename it, move it. and I'm darn sure not going to attempt to
copy it, it just might work ;)

I'm starting to envy you. Really, I'm sure I can whack them it's just too
complicated remotely.

The weird thing is that this never happens on FAT. I wish it would, I know
how to whack things on FAT :p

The names you copy/pasted got formatted to actual question marks, they are
ASCII 63, so no use there.

Any idea on how the file got there, I want one :)
 
R

R. C. White

Hi, Ndi.

Back in MS-DOS days, some pranksters liked to create filenames with
valid-but-unprintable characters. A simple example:

md "te t"

That blank space replacing the "s" in "test" is not a hex 20 (ASCII 32), but
hex 255 (entered by holding down the Alt key while typing 255 on the numeric
keypad). It's unprintable, but it's there - and it's NOT a Space character.
Dir shows it as "te t". Dir /x shows "te t" in the LFN column, but "TET~1"
in the SFN column.

rd "te t" - using a space, gets me "The system cannot find the file
specified."

rd te* - using a wildcard, get "The filename, directory name, or volume
label syntax is incorrect."

rd tet~1 - removes the directory.

I'm not sure how this applies to your problem file, but it illustrates that
even "short" filenames, with no visible illegal characters, can still be
invalid 8.3 names. But dir /x should show a valid 8.3 name.

RC
 
O

Overlord

Can you highlight and Move the files to a floppy?
Then reformat the floppy......<EG>

Can you right click and rename the files to like trash.txt?
Can you right click and change the files to non s/h/a files?

Can you move everything else out of the directory and deltree it?

Can you use the command prompt to move the files *.* to \nul?

Back in the DOS days I used a util called Directory Master; still do
on occasion. I bring it up, highlight the file and delete it. The
util never seemed to care what the file was calling itself.
I trust the files aren't locked up or open by some other app or
association?

Admittedly the DOS days weren't that far back. When I finally left
the command prompt and DesqView behind and decided on Winders as an
OS, M$ was up to 98SE. I still keep the util around for just such an
occasion tho....

I have a number of files on my Windows 2000 server that I
cannot delete. Some of them have names with strange
characters and some do not. This stems from a problem we
had about a year ago when our RAID controller went down.
We were able to reinstall the operating system on the C:
drive and recover the data from the D: and E: drives;
however, there were some files that were corrupted and I
am unable to erase them. I have tried running chkdsk /f
and that has not eliminated the files. I have also tried
to delete the files from the command prompt, but was
unsuccessful. One of the file names is 113?1D2?|wd.
Another file contains characters that don’t even exist on
the keyboard. How can I erase them?
~~~~~~
Bait for spammers:
root@localhost
postmaster@localhost
admin@localhost
abuse@localhost
postmaster@[127.0.0.1]
(e-mail address removed)
~~~~~~
Remove "spamless" to email me.
 
O

Overlord

BTW..... I download and burn Knoppix version of Linux on CDs.
It's really nice as the entire thing runs entirely in ram never
touches the hard drives unless you want to access them (unless you're
short on ram, then it begs for a swap file....).
It finds all the onboard whatevers and loads drivers for 'em.
Even loads drivers for my NIC and lets me access the net thru my cable
modem, all with no interaction from me at all.
Loads drivers for onboard sound, dual NICs (1 onboard gigabit, 1 PCI),
dual SCSI cards, USB, the works.
I take it to work sometimes when NT won't load from the HD because
it's lacking a file. Use it on other people's systems to DL drivers
for their NIC, because they can't get on the net, because they don't
have NIC drivers, because the can't...... uh, yeah.
Also, it's great for copying Winders over for backup as there are NO
open files on the hard drive. Beats the hell out of a 6.22 floppy
booting to a prompt that won't even see the NTFS drives without
another utility.

Anyway.... perhaps it would be more amenable to deleting files
especially since they CANNOT be open.

My 6 year old son dual boots ME and Linux for some of the games. I'm
happy because he can just shut the system off when he's done and it
can't corrupt files on the CD.

Might work....

I have a number of files on my Windows 2000 server that I
cannot delete. Some of them have names with strange
characters and some do not. This stems from a problem we
had about a year ago when our RAID controller went down.
We were able to reinstall the operating system on the C:
drive and recover the data from the D: and E: drives;
however, there were some files that were corrupted and I
am unable to erase them. I have tried running chkdsk /f
and that has not eliminated the files. I have also tried
to delete the files from the command prompt, but was
unsuccessful. One of the file names is 113?1D2?|wd.
Another file contains characters that don’t even exist on
the keyboard. How can I erase them?
~~~~~~
Bait for spammers:
root@localhost
postmaster@localhost
admin@localhost
abuse@localhost
postmaster@[127.0.0.1]
(e-mail address removed)
~~~~~~
Remove "spamless" to email me.
 
N

Ndi

1) He already stated DIR /x failed - that's what makes it interesting.
2) Back in the old DOS days you just lock the blasted FAT16 and edit the
file physically to rename it to something manageable.

I used to do that to delete HUGE directories with no cache - it takes
hours. I nuked the dir entry, scandisk'd and converted the dir to a file,
then deleted it. Takes 30 secs. On NTFS, however, this is quite complicated.
 
N

Ndi

Can you highlight and Move the files to a floppy?
Then reformat the floppy......<EG>
Can you right click and rename the files to like trash.txt?

If rename worked, we woldn't be here, he would rename to 1.txt and delete
it. For the same reason, if move worked, he'd just move to recycle bin and
we would be discussing "recycle bin never gets emptied".
Back in the DOS days I used a util called Directory Master; still do
Admittedly the DOS days weren't that far back. When I finally left
the command prompt and DesqView behind and decided on Winders as an
OS, M$ was up to 98SE. I still keep the util around for just such an
occasion tho....

All this assumes FAT. On FAT, deletion is never an issue as posted above.
 
O

Overlord

If rename worked, we woldn't be here, he would rename to 1.txt and delete
it. For the same reason, if move worked, he'd just move to recycle bin and
we would be discussing "recycle bin never gets emptied".

Did he? I don't see that. The original poster's posts;
-------------------------------------------------
"I have a number of files on my Windows 2000 server that I
cannot delete. Some of them have names with strange
characters and some do not. This stems from a problem we
had about a year ago when our RAID controller went down.
We were able to reinstall the operating system on the C:
drive and recover the data from the D: and E: drives;
however, there were some files that were corrupted and I
am unable to erase them. How can I erase them? "
---------------------------------------------------
And his only other post;
----------------------------------------------------
"I have a number of files on my Windows 2000 server that I
cannot delete. Some of them have names with strange
characters and some do not. This stems from a problem we
had about a year ago when our RAID controller went down.
We were able to reinstall the operating system on the C:
drive and recover the data from the D: and E: drives;
however, there were some files that were corrupted and I
am unable to erase them. I have tried running chkdsk /f
and that has not eliminated the files. I have also tried
to delete the files from the command prompt, but was
unsuccessful. One of the file names is 113?1D2?|wd."
Another file contains characters that don’t even exist on
the keyboard. How can I erase them?"
-----------------------------------------------------

Tried to delete files and couldn't. Ran chkdsk and it didn't erase
them. Perhaps you would be so kind as to point out where he tried to
Rename them? Or alternately where he tried to Move them?
Perhaps you have some sort of mental telepathy where you know what he
did and didn't do even when he doesn't post a damn thing about it.
I'm trying to help the guy by finding out what he actually tried; as
opposed to what your mental telepathy assumes he tried.

I also find whining counterproductive
All this assumes FAT. On FAT, deletion is never an issue as posted above.

"All this" does not assume anything; you do. FYI the utility I
mentioned just deleted files for me from my C drive 15000rpm SCSI
NTFS. Now back off boy, I ain't in the mood.~~~~~~
Bait for spammers:
root@localhost
postmaster@localhost
admin@localhost
abuse@localhost
postmaster@[127.0.0.1]
(e-mail address removed)
~~~~~~
Remove "spamless" to email me.
 
N

Ndi

Now back off boy, I ain't in the mood.

* "Mood" is no excuse for rudeness.
* As for my telepathy, short file name generation is only available for
NTFS - I assumed this was the case.
* As for "moving to \nul", I suggest further documentation...
* Finally, I would suggest you document on the API limitation that
generates this problem, perhaps deeper understanding of the issue would lead
to different answers (try DeleteFileW vs DeleteFile(A) - WinBase.h). Also,
please note that this is probably the 50th post on the issue, most people
tried most tricks, rename being one of them. As M Mullen stated, he has
already googled for previous posts in which this has been addressed. Perhaps
this is the reason we skipped over the obvious part.

Also note that my post referred to the technical approach of the problem,
not personal aspects. This is a newsgroup, your dislike of a certain person
should not be here.
 
O

Overlord

* "Mood" is no excuse for rudeness.

Then I apologize. It was based on my preception of your reply.
That has not always been accurate.
* As for my telepathy, short file name generation is only available for
NTFS - I assumed this was the case.
* As for "moving to \nul", I suggest further documentation...
* Finally, I would suggest you document on the API limitation that
generates this problem, perhaps deeper understanding of the issue would lead
to different answers (try DeleteFileW vs DeleteFile(A) - WinBase.h). Also,
please note that this is probably the 50th post on the issue, most people
tried most tricks, rename being one of them. As M Mullen stated, he has
already googled for previous posts in which this has been addressed. Perhaps
this is the reason we skipped over the obvious part.
I was attempting to reply to the originator of the thread. His
research was not as indepth as M Mullen's.
Also note that my post referred to the technical approach of the problem,
not personal aspects. This is a newsgroup, your dislike of a certain person
should not be here.

Don't know you well enough to dislike you. More like a case of
mistaken identity...


Tho it is difficult to suggest when I don't have the file here to test
it on. I do recall trying to nuke reluctant files. Something like
booting to dos and trying to LZH/RAR/Zip/ARC/ARJ/ICE/Zoo the file into
a compressed file of a different name with the correct switches to
move the file into the new compressed file and the right *.* filemask
to cover anything in the directory.

I really have had good luck over the years using Directory Master to
nuke nasty files;

http://www.ctyme.com/download/share/dm3.zip

If that doesn't do it, this util shows great promise. Supposedly
bypasses the OS for direct access; dunno. I have it installed but,
not being motivated by having files with ASCII/ANSI characters in the
filename, I'm hesitant about editing the drive directly.

http://www.theabsolute.net/sware/dskinv.html
~~~~~~
Bait for spammers:
root@localhost
postmaster@localhost
admin@localhost
abuse@localhost
postmaster@[127.0.0.1]
(e-mail address removed)
~~~~~~
Remove "spamless" to email me.
 
N

Ndi

Tho it is difficult to suggest when I don't have the file here to test

Yeah, I'm more interested in how to replicate it in my drive than fixing
it :)

That way I'd also know how it got there, even though I suspect invalid
DBCS (widechar) data. It worked for creating undeleteable registry ...
I really have had good luck over the years using Directory Master to
nuke nasty files;

It probably has its own file system interpretor, such as some other tool I
had (forgot its name - ex2 explorer?) that could browse ex2 or whatever it's
called - the native Linux file system. In that case, it could be done but
NTFS5 is quite complex and you have to touch the file system log. If it gets
restored by chkdsk one could shoot oneself :)

It was considerably easier on FAT. Especially with Norton's DiskEdit, it
had a view > as FAT.
 
N

Ndi

Update:

I built and ran an application that creates a file for each possible DBCS
char, a total of 64.000 files (some have reserved names). Then I deleted
them (successfully) with the dir command. Chkdsk reports no problem.

I have *no* clue on how those files got created.
 
O

Overlord

Yeah, I'm more interested in how to replicate it in my drive than fixing
it :)

That way I'd also know how it got there, even though I suspect invalid
DBCS (widechar) data. It worked for creating undeleteable registry ...


It probably has its own file system interpretor, such as some other tool I
had (forgot its name - ex2 explorer?) that could browse ex2 or whatever it's
called - the native Linux file system. In that case, it could be done but
NTFS5 is quite complex and you have to touch the file system log. If it gets
restored by chkdsk one could shoot oneself :)

Hmmmm, you think Linux could do it?
One of my favorite "tools" is Knoppix version of Linux. I even keep a
copy at work. You can FTP a copy at www.knoppix.com. It's a 700+meg
image file. Image it to a CD and you have a bootable version of Linux
that runs entirely in RAM and doesn't use the HD or even care if
there's a HD in the system. It'll mount and access FAT16, FAT32,
NTFS, and Linux partitioned drives.
How many times have you answered posts that someone can't find NTLDR
or NTOSKRNL.EXE, has no install disk, can't boot, and a DOS boot won't
see the NTFS disk? The system is dead in the water.
Or occasionally something like, I need the new NIC driver so I can get
on the internet but I have no NIC driver so I can't get on the
internet to download the new.....
Or, my windows blew up and I need the data off the drive before I
repartition.
Knoppix boots, finds my OB sound, monitor, dual SCSI cards, dual NICs,
cable modem, everything. I can boot the CD, browse the internet and
dl whatever files I need and still save them to the NTFS drive for
later. Mighty handy! Perhaps it could have a shot at nuking the
ghost file.....
~~~~~~
Bait for spammers:
root@localhost
postmaster@localhost
admin@localhost
abuse@localhost
postmaster@[127.0.0.1]
(e-mail address removed)
~~~~~~
Remove "spamless" to email me.
 
O

Overlord

Remember the old BBS ANSI bombs?
Don't know how well off hand 2K interprets ANSI these days....
I do wonder tho if you could use escape codes to create a filename.
Or put them in a batch file..... and pipe them to create a new
filename

Update:

I built and ran an application that creates a file for each possible DBCS
char, a total of 64.000 files (some have reserved names). Then I deleted
them (successfully) with the dir command. Chkdsk reports no problem.

I have *no* clue on how those files got created.
~~~~~~
Bait for spammers:
root@localhost
postmaster@localhost
admin@localhost
abuse@localhost
postmaster@[127.0.0.1]
(e-mail address removed)
~~~~~~
Remove "spamless" to email me.
 
N

Ndi

I do wonder tho if you could use escape codes to create a filename.
Or put them in a batch file..... and pipe them to create a new
filename

In theory, no dice. Regardless of what you escape, the chars go to
CreateFile and DeleteFile. And those should return false if such a name is
attempted. Unless, of course, CreateFile first checks and then creates in
which case a call to "Moo\?.txt" will create an invalid file unless you know
what you escaped and want to delete it. If DeleteFile doesn't escape,
however, you got yourself a HDD gem :)

If CreateFile disallows such names, CMD can't create them. I doubt it uses
undocumented API. If it did, they'd show up in a exe dump as dependency. A
list of imports CAN me created from an EXE.

I haven't tried to escape a bad name to CreateFile. Maybe this could be
it. And assuming they used MSVC to write it, it should escape C-style, with
backslash chars. Still, if they use something else to escape for their own
internal use, not much I can do to find out. Disassembling the code is
somewhat illegal and beyond my oh-my-friendly-compiler level :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top