Go Back   TechArena Community > Technical Support > Computer Help > TroubleShoot 98
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , ,

Sponsored Links



How to Delete Huge Folder Containing Files with Invalid Names

TroubleShoot 98


Reply
 
Thread Tools Search this Thread
  #1  
Old 28-05-2009
Ellen
 
Posts: n/a
How to Delete Huge Folder Containing Files with Invalid Names

A crash filled my Firefox cache folder with tens of thousands of files
and subfolders with invalid characters in their names. As a result, I
can't delete the folder.

Here's what I tried and has failed so far:

Moving folder to recycle bin
Renaming folder to cache.tmp and using a utility called "Empty Temp
Folders" to delete files
Trying to delete files in the folder from a DOS command line prompt
Trying to clear the cache from Firefox
Making the cache size preference very small, closing and opening Firefox
Using System Suite, a disk management utility
Using DelinvFile, a utility designed to delete invalid files
Using PurgeFox, a utility designed to clear the firefox cache,

Sometimes these methods hung, and sometimes they returned error messages
about invalid file names, locked files and denied access.

I really want to get rid of this junk. Can anyone tell me how to delete
the folder and its contents or recommend a program that will do so?
Reply With Quote
  #2  
Old 28-05-2009
Buffalo
 
Posts: n/a
Re: How to Delete Huge Folder Containing Files with Invalid Names

Have you tried a free program called CrapCleaner (CCleaner)?
Or
Have you tried uninstalling Firefox, then possible deleting any leftover
files that you don't need and then reinstall FF?
Uninstalling and reinstalling may be the easiest. Make sure you dl and save
the version of FF you need before you uninstall.
Reply With Quote
  #3  
Old 28-05-2009
Bill Blanton
 
Posts: n/a
Re: How to Delete Huge Folder Containing Files with Invalid Names

What's the exact name of the folder? You said you tried from a
DOS command-line prompt. Have you tried using the deltree command?
Or possibly from a boot to DOS?
Reply With Quote
  #4  
Old 28-05-2009
Bill in Co.
 
Posts: n/a
Re: How to Delete Huge Folder Containing Files with Invalid Names

You could try booting up in real DOS mode and using the Deltree command.
(But be careful with that command as to what you are deleting - it deletes
the directory specified and its subdirectories)
Reply With Quote
  #5  
Old 28-05-2009
MEB
 
Posts: n/a
Re: How to Delete Huge Folder Containing Files with Invalid Names

That is a problem..

First we should make sure you are using Win98, are you?

IF SO:
You will likely not be able to use a Windows 98 based utility to do
the delete. The issue appears similar to attempting to delete NTFS files
[left-overs from the OS] from a hard drive or device, or those indicated
in the below:
http://support.microsoft.com/kb/320081
So potentially, you may be able to use XP or VISTA to change "some" of
the particular issues in Administrator Mode.

A. One method might be an un-install of FireFox. Make sure you export
your Book Marks and other before deleting for re-importation.
This may not work as FireFox is no longer in control of the files, nor
is Windows.

Other potentials:

1. From the command prompt, try using deltree {drive:/the folder
hierarchy}, the problem here is the depth involved within FireFox
folders and 8.3 file convention. LFN [a long file name tool] likely will
not be helpful, though you could attempt to use it during the process.
IF you can first cd into the last folder before the cache, the command
becomes deltree {the folder}. The issue might still remain the corrupted
Unicode characters [the former long file names/sites/URIs now converted
to weird names, permission indicators, purported short file names, and
other such junk now located in the FAT tables and actual file indicators].

2. A simpler method might be to download one of the smaller LIVE Linux
distributions and attempt the delete through the disk tools there.
You will need to "mount" the drive with read/write/delete access. The
default is usually read-only - go to properties or similar for the disk
and change the access rights.
*AFTER mounting the drive and changing rights*, go into the folder
PRIOR to the cached materials, and delete the folder with the corrupted
files.
*DO NOT* read [look at/into] the corrupted folder first, just attempt
the delete [reading the folder caches [or attempts to] the files and
folders]. You will be using something similar to Explorer [Nautilus or
similar, or possibly the Konqueror browser]. Make sure to confirm and
*write* to the disk. OR from terminal as SU or ROOT use * rm * on the
folder/file.

*NEITHER* of these methods are guaranteed to work.

3. And of course there are dozes of other recommended procedures, here's
one link which provides a couple of solutions [read the comments for
additional tools and techniques]:

Hey, why re-write what's already out here...
Reply With Quote
  #6  
Old 28-05-2009
philo
 
Posts: n/a
Re: How to Delete Huge Folder Containing Files with Invalid Names

When your machine crashed it seems to have left quite a few logical
drive errors.
You will need to run scan disk and let it correct the errors.

Once the errors are corrected the files should be deletable
or possibly written to .chk files which can be deleted
Reply With Quote
  #7  
Old 28-05-2009
Robert Macy
 
Posts: n/a
Re: How to Delete Huge Folder Containing Files with Invalid Names

I had a similar problem when a memory stick corrupted on me. I ended
up with the weirdest characters I'd ever seen as names for something
Win98 'thought' were files. Albeit, not as many as you have.

I tried in DOS command also with no success. But, I ran this first

then I used a free hex editor, called Hexeditor to look at
directry.txt and get a list of the file names. and printed out the
hex file. Then, armed with the hex list, I went back to command mode
and INDIVIDUALLY used

using the alt-character ability I deleted every weird file.

The files generated by my crash could not be moved into a
subdirectory, or deleted using deltree command. This was the only way
and it worked. Only had 100+ or so, so it was a project I worked at
from time to time. until finished.
Reply With Quote
  #8  
Old 29-05-2009
MEB
 
Posts: n/a
Re: How to Delete Huge Folder Containing Files with Invalid Names

That technique would certainly be a candidate for automation. This
issue becomes more of a problem with each passing day and each differing
OS. Thanks for bringing the limitation of DOS/Windows. OF course the
limitation also applies to scandisk and other disk maintenance tools [if
the files/folders can't be read [except at hex level], converted [such
as to .chk files], moved [they are "owned" yet nothing owns/controls
them], or deleted [invalid characters and extensions], potentially they
become un-usable disk space.].
*It appears* these corruption issues could be collected and passed to
a relatively small bit of code. Certainly a C or Delphi [or even
potentially assembly] could be used in a true cross-platform application
which could be run from a disk or stick. Perhaps even a simple batch
relying upon a couple base programs [such as you displayed].

I would think that the world would be thankful, particularly as this
now also affects phones, music devices, memory sticks, and other.
I can see though, that the potential mis-use of such coding could be
an issue.. though the technique appears to be used by some of the
various virus/SpyWare/trojans/hacks presently occurring [such as
rootkits and such].
Reply With Quote
  #9  
Old 29-05-2009
PCR
 
Posts: n/a
Re: How to Delete Huge Folder Containing Files with Invalid Names

What message do you get? That the folder is in use?

Did it refuse to go into the Recycle Bin?


(1) You were able to rename the folder,
& unable to delete the renamed folder?
What was the error message?

(2) Did FireFox still regard it as its cache after that?
(I don't know how to tell-- maybe use FireFox & check
whether the original folder is recreated or whether
the renamed folder grows?)

(3) What is the name of the folder now...?...

(a) Open Explorer to the folder.
(b) Copy the name from the Address Bar,
& paste it into these quotes...
"".
(c) If there is no Address Bar, activate it by Right-Clicking
Explorer's Toolbar (where the Menu buttons are).
(d) R-Clk the folder in Explorer's left pane,
select "Properties" & post its MS-DOS Name.

(1) What message did you get-- "File not found"?
(2) Did you do a DIR & see the file?
(3) At a Windows DOS Prompt,
opened to that folder...

(a) DIR > C:\Windows\Temp\Cache.txt
(">" redirects output to a file.)
(b) Post a bit of Cache.txt for examination.

Did you give it enough time? It can take an eternity to do that in IE!

I don't know. Maybe you needed to do more after that-- like opening &
using FireFox? Rebooting? Does FireFox still work?

Give us the Windows & MS-DOS names of the folder. Maybe DELTREE will get
it after a direct boot to DOS. But you must be CAREFUL with
Deltree...!...

C:\>deltree/?
Deletes a directory and all the subdirectories and files in it.

To delete one or more files and directories:
DELTREE [/Y] [drive:]path [[drive:]path[...]]

/Y Suppresses prompting to confirm you want to delete
the subdirectory.
[drive:]path Specifies the name of the directory you want to
delete.

Note: Use DELTREE cautiously. Every file and subdirectory within the
specified directory will be deleted.

There also is a DOS UNLOCK command, but it appears to do with drives--
not files or folders...

C:\>unlock/?
Unlocks a drive, disabling direct disk access for an application.

UNLOCK [drive:]
Reply With Quote
  #10  
Old 31-05-2009
mm
 
Posts: n/a
Once and only once, about 15 years ago, I had a directory D three or
four levels below the root that had a directory in it that was
actually the root directory C:\. I knew something was wierd but
didn't realize what would happen if I deleted the directory.

I think I only had DOS then, and I deleted *.* for directory D, and
while I watched it started deleting all the directories under C:\. I
was dumbfounded for a few seconds but turned the computer off after
about 150 files were deleted. About 120 of them I was able to
undelete, but for 20 or 30, I couldn't figure out what the first
character was, because I had no list of the files. Or sometimes there
were two choices. I undeleted all the files but didn't give the right
name to 20 of them, but luckily I never seemed to need them.

I think the problem remained after all this and I solved it by running
Scandisk. I should have done that before I deleted anything. :)

Oh, yeah. So the point of my last post must have been to run scandisk.
Maybe it will rename bad names. ???
Reply With Quote
  #11  
Old 06-06-2009
Ellen
 
Posts: n/a
Re: How to Delete Huge Folder Containing Files with Invalid Names

Thanks for all the creative and practical advice!

I haven't been able to log on to the newsgroup before now because
deltree effectively took out my net connection. After I ran it, my
dialup internet connection speed was never more than 300 bps, making it
impossible to connect to anything. And after I ran deltree, my firewall
would not load. Now I'm on a friend's pc.

Here are replies to individual messages.

According to its description, CrapCleaner doesn't remove invalid files,
only unused and tmp files.

I don't think uninstalling firefox would have worked and i didn't try it
because the problem is in the directory structure.

To those who asked about the folder's name, it was originally cache and
i renamed it cache.tmp as well. i tried all DOS and windows
troubleshooting basics on both names. Both DOS and windows recognized
each name in a variety of operations (dir display, rename, trying to
move to recycle bin).

Using linux really appeals to me, MEB. simple, clean, and i remember
erasing dumps on one of my isp's unix shell's with one command. i am
interested in trying it after i move my data to a more stable pc.

i ran a utility like scan disk (system suite) which began renaming the
invalid files. but it prompted me for each file and continuing it with
20,000 - 50,000 files was impractical.

Perhaps scandisk does it without prompting, but i don't want to tinker
until I copy my data.

I have a hex editor, which i used once to undelete some jpgs, but using
it with all these files is also not practical.

MEB, I agree (putting it into my words here) that it's all Bill Gates'
fault. If crashes and outages create invalid files on an o/s the
programmers should provide a way to recover.

(Along these lines a friend of mine thought it would be possible to
write a simple script or program that would parse each character of each
filename, and if invalid change it to a random valid one, if valid to to
next character, and so on, with some kind of check to prevent duplicate
new filennames. If such a program exists, please let us know what it is.)

To PCR: I got messages from various disk maintenace programs about
invalid file and subfolder names. deltree said directory structure was
bad (i assume due to the invalid names). windows error message when
folder wouldn't go into recycle bin was usual vague one: "disk could be
write protected or in use." (again, thank you bill gates!) Oddly firefox
didn't crash, but i renamed the cache folder each time i opened firefox
so it created a new cache folder.

the disk uitilities returned invalid names like this: a<#$bg d&^
a DOS dir command returned names like this: AAAAAAAAB gba
some of the files were locked too.

Again, thank you so much everyone for your help and ideas. I'm sad to
lose my win98 box this way. It has been an excellent machine for over 12
years.

Ellen
Reply With Quote
  #12  
Old 07-06-2009
MEB
 
Posts: n/a
Re: How to Delete Huge Folder Containing Files with Invalid Names

Hmm, what the heck did you deltree?
I suppose it might be that you had severe corruption elsewhere as well
and it was ALL placed into a supposed single folder.

Right, use the previously mentioned technique [make sure you don't
look at the corrupted directory or enter it or it may produce a *hard
cache*].

Command would look like:

1. rm -r -f {the full drive and path} {look in media for the drive if
you need to} or

2. when logged into the drive [mounted]
rm -r -f {the full path} or

3. if already in the master directory [the one containing the
sub-directory with the corrupted files, NOT the actual corrupted directory],
rm -r -f {the directory} (this may not work as Linux works from the
root {/} > up and does provide in-built protections and requirements per
the various compilations)

-r = recursive

-f = forced with no required input like yes or being required to
individually choose the directories and files to delete

This MAY [depending upon the Linux used] require you be root or su [or
sudo, ksudo, or other], e.g., super user. You shouldn't need to chown
[change ownership] when root or su *IF* you already mounted the drive
and assigned read, write, execute [777] access [most defaults are *read
only* for pre-existing partitions/drives and folders/files].

IF you're really interested in Linux then note Wine [Windows emulator]
has come a long way [which is what I'm using for some of my favorite
Win9X programs]. And you now have several virtual machine
implementations to choose from for the Linux environment in which to run
Windows. Look for an i386 installation for older computers [they will
upgrade themselves over time to the proper processor [like i586, or
i686], or choose an i586, [Celeron, P1, P2, P3] or i686, or _64 [dual
core and above] compilation if you have a newer processor.

ScanDisk [and the like - DOS/9X based tools] likely will NOT work and
may actually be the app that created the issue. It MAY try to rename
them or create *.chk files [thousands at times], but the possibly
corrupt FAT entries precludes change [because of the invalid file names
which can not be changed via DOS and FAT entries which purport to be
"locking schemes, encryption, and other"] and deletion.

I have tried many of those that CLAIM to be able to provide those
functions [I'll not list them as depending upon the corruption SOME may
provide a bit of use], however, I have found none [Win9X capable] which
can deal with files which have been converted during recovery attempt or
other corruption after they have been changed to unrecognisable formats
now listed in the FAT as having file protection, locks, and other
aspects after the conversion.
Running a partitioning tool may sometimes attempt to create a separate
partition for them [if located in a recently defragged condition], or a
recovery tool such as TestDisk or HDat2 may think they are from an NT
file system yet can not locate the proper MFT tables for them.
WinHex [9X version, such as 12.8] will show them with NT style file
protections, encrypted files, and other indicators and MAY not be able
to delete them either [depending upon whether you tried other recovery
techniques first].

They get "locked" because DOS [the underlying 9X OS] and FAT do not
know how to handle files in the form now being created by web accessing
programs, e.g., with spaces, commas, special characters, and other, when
the controlling program loses access/control or otherwise corruption
occurs upon/within file entries, like when a scandisk is run from a DOS
prompt after a crash or automatically.
My gripe: It isn't that these special characters and MASSIVE page
names are NEEDED, blame it on ignorant web developers, and some of the
coding they now use...

Make it easy on yourself, if you have a high speed connection, limit
caching to 2 to 10 megs MAX [regular plain web page usage; with
movies/video or the like you may want a hundred or so, though if
possible use ITS caching rather than the browsers or download first] so
any corruption becomes easier to clean-up and the controlling app
[browser, etc.] has less trouble dealing with the files. Most browsers
and web apps, IMO, have WAY to much allowance for caching in their defaults.

Its still a good OS, just needs a little help and support in today's
world.
Reply With Quote
  #13  
Old 07-06-2009
MEB
 
Posts: n/a
Sorry, forgot to include that it is advisable to check that disk for
virus and other PRIOR to data recovery. You don't want materials with
virus included.
Might also want to check the drive itself (check S.M.A.R.T. and other)
to see if you are having hard drive failure.
TestDisk, MHDD, and HDat2 [though I think it now is not free] can
check drive statistics.
You may be able to use a Live Linux [depending upon the compilation]
to check as well. You can use the LiveCD to recover/move files to
another drive if necessary.
Reply With Quote
  #14  
Old 07-06-2009
motzie
 
Posts: n/a
Re: How to Delete Huge Folder Containing Files with Invalid Names

I was running up-to-date anti-virus and anti-spyware programs before the
crash as well as a firewall, so I'm pretty sure there are no viruses and
trojans. Good idea about checking the drive, which I'll do when the
data is off. Aside from the slow net connection and one program that
won't load, everything else has been working well.

Thanks again for your help. I'll be back online in a few days, and
will have the time to start moving my data midweek. I won't try to
delete the file with linux until my data is safe and backed up.
Reply With Quote
  #15  
Old 07-06-2009
MEB
 
Posts: n/a
Re: How to Delete Huge Folder Containing Files with Invalid Names

Yeah, too late, once ANY DOS/9X program [fat based] attempts to fix
the corruption.
It may also have been related to the registry looking for files no
longer existing..

Hmm, an older kernel [and site - 2003].. not familiar with that
compilation so I can't advise one way or another, though it does purport
to have fat and vFat support compiled in the kernel.

The LiveCD compilations won't install anything to the drive IF you
have enough memory, they use virtual drives. IF you're memory is
limited, then a *temporary* space is used, though cleaned up when
logging off/shutting down.

I hope this works for you, though it may not...
per the other post,, you may have a failing hard drive or other issues.

It seems to come into play when even the short file name [8.3 format]
get corrupted when the fat is modified by the scanning program to
reflect the supposed name found/created - also containing invalid
characters. I've had the programs recommend over-writing one fat with
the other [which doesn't work] compounding the problem.

Caught immediately, TestDisk MAY have been able to correct the
entries, though my guess is you also have registry issues as well.

I never really understood WHY so many recommended large caches, even
when phone lines/connections were used [and WHY would you do that with
broad band, to save a few seconds??? {though I suppose if you're paying
by the hour or something..}]. Then again I may be more patient coming
from the era of slow computers (8, 10, 12mhz. - 8088, 8086, V10-V20,
etc..), PAINFULLY SLOW connection speeds (2400 baud) and poor telephone
lines (dang, yet another connection loss, gees, more long distance
charges ...).

Good luck, let us know how it works out for you.
Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > TroubleShoot 98


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to Delete Huge Folder Containing Files with Invalid Names"
Thread Thread Starter Forum Replies Last Post
Bash command to delete entire Files from folder Strangers Windows Software 4 11-11-2010 09:30 PM
How to locate and delete files from OLK23/OLK1DE folder chrisadig Windows XP Support 9 20-10-2009 10:29 PM
BAT file to delete all .tmp files in a certain folder Larry TroubleShoot 98 13 30-07-2009 05:06 AM
How can I delete files in system32 folder? Renderman21 Operating Systems 3 23-07-2009 09:15 PM
DRM Error - Can't delete files in DRM folder Paul Media Player 0 16-01-2008 12:58 AM


All times are GMT +5.5. The time now is 04:22 PM.