Can't delete folder!

A

Asger-P

Hi Char

I'm in the same boat with you. I've been using personal computers
since 1982 and Windows since 1991 and I don't remember a single time
I've needed a 3rd party utility to help me delete a file or directory.
Reading this group, you'd think this was a fairly common thing, but
not for me.
Sounds like You never worked on a public school.
I dont know if this still goes, but when I worked on a school
14 Years ago I often came across folders that couldn't be
deleted because the length of their path was more then 260
chars (MAX_PATH).
The kids created these folders by making a new folder with
a long name then they made a copy of that and dropped the
first one into the copy and they kept doing that for as long
as they could.
And that could be done because such a copy only involves
adjusting a few bits in the disk table or what it's called.
but when deleting such a folder the delete function have
to go through the whole structure of the folder in order to
delete recursive and there by exceeded the MAX_PATH in the
function.

The tool I made at the time used 8.3 filenames in order to
shrink the path below MAX_PATH.

There was no other way to delete those folders, it was not even
possible to browse to the bottom of them in the explorer.


Best regards
Asger-P
 
P

Paul

The said:
Paul: The path is C:\Users\Seabat\Desktop\Downloads\552518 -
552518 being the folder I'm trying to get rid of. There are two
sub-folders inside that one that won't delete either.

Unk: Tried that route. . .No joy!

Looks like I might have to try one of those 3rd party utilities and
see iffn they will work!

- -
The Seabat
For fun, I tried duplicating your experience.

1) Used Firefox.
2) Set downloads to equiv of C:\Users\Seabat\Desktop\Downloads\552518
3) Downloaded a couple things, and unzipped them in the same folders.

Results:

1) No problems deleting 552518.
2) If another download attempted while 552518 is in recycle bin,
Firefox creates a new 552518 on the desktop. Moving file out of
trash and back to desktop, resulted in dialog asking to "merge" the
folders. Seemed to work.

So not really a strange result so far.

However, CPU utilization went up, so something on the laptop, just
doesn't like this. Tried TaskManager and Process Explorer and
couldn't nail it down. Firefox would occasionally spike in CPU
usage. I did have very high CPU usage, and had to reboot the laptop
to see if it would clear, and it remained jumpy on the second
boot.

Restoring Firefox to use my regular (non-Desktop) download folder,
and moving the 552518 folder below the download folder, returned
everything to normal.

Conclusion:

Maybe my AV doesn't like this ? I can't figure it out. All
I can tell you, is it was sure eating into my battery life.
Nothing like a pig of a single core computer, running
pegged all the time.

So I won't be keeping a 552518 folder on my desktop, anytime soon :-(

Paul
 
N

Nil

I dont know if this still goes, but when I worked on a school
14 Years ago I often came across folders that couldn't be
deleted because the length of their path was more then 260
chars (MAX_PATH).
The kids created these folders by making a new folder with
a long name then they made a copy of that and dropped the
first one into the copy and they kept doing that for as long
as they could.
And that could be done because such a copy only involves
adjusting a few bits in the disk table or what it's called.
but when deleting such a folder the delete function have
to go through the whole structure of the folder in order to
delete recursive and there by exceeded the MAX_PATH in the
function.
I have seen that, although it seems to me that it was caused by
transferring a file or folder from a non-Windows system via FTP or
something. Can't remember what, but it was an unusual combination of
factors.

I just now tried what you describe, on Windows XP. I created two
folders"

e:\A very very very very very very very very very very long name\

and

e:\A very very very very very very very very very very very long name\

I copied the the first into the second, then another copy of the first
into the new subfolder, etc. After a depth of 3 levels, the folder name
was 193 characters, after which it wouldn't let me put another copy of
that folder in there, which would have made the name 256 characters.
The error message said "The filename or extension is too long."
The tool I made at the time used 8.3 filenames in order to
shrink the path below MAX_PATH.

There was no other way to delete those folders, it was not even
possible to browse to the bottom of them in the explorer.
I've been successful using "rd /s", maybe in conjunction with the 8.3
name.

I know these can be a bitch to remove once they manage to be creative,
but somehow I've always been able to remove them with common tools, and
I never felt like I needed a third-party utility.
 
J

Joe Morris

The Seabat said:
Running Win7 H P 64-bit

I have a couple of folders inside a folder on my desktop. I can't
delete them! Every time I try it says that they aren't there, but they
are. I've re-booted, been into SafeMode and even right clicked and
entered Properties>Security>Edit, etc, etc, etc and gave permission at
one time or another to everyone listed (2). No joy!

How do I get rid of these pesky folders? There are no files inside of
them, they are empty, save for a couple of sub-folders. Can't delete
the sub-folders either.

Am I going to have to re-install Windows to get rid of these freakin'
things? Thanks for any help.
In addition to the good suggestions made in other responses to your posting,
don't forget that what you see as the desktop on your display is actually
the result of merging the contents of two folders: your own personal desktop
(a folder in your profile) and the common desktop that's shared by all users
of the computer (plus a few icons that don't represent file system objects
at all, such as "Computer" and "Network"). It's possible that the folders
you want to delete are in the common desktop.

Open C:\Users\Public\Desktop to see what (if anything) is in the common
desktop folder. You'll probably find that interactive users get only read
and read/execute access to contents of the common desktop; you'll need
administrator rights to delete anything here.

Joe Morris
 
P

Paul

Nil said:
I have seen that, although it seems to me that it was caused by
transferring a file or folder from a non-Windows system via FTP or
something. Can't remember what, but it was an unusual combination of
factors.

I just now tried what you describe, on Windows XP. I created two
folders"

e:\A very very very very very very very very very very long name\

and

e:\A very very very very very very very very very very very long name\

I copied the the first into the second, then another copy of the first
into the new subfolder, etc. After a depth of 3 levels, the folder name
was 193 characters, after which it wouldn't let me put another copy of
that folder in there, which would have made the name 256 characters.
The error message said "The filename or extension is too long."


I've been successful using "rd /s", maybe in conjunction with the 8.3
name.

I know these can be a bitch to remove once they manage to be creative,
but somehow I've always been able to remove them with common tools, and
I never felt like I needed a third-party utility.
I tested this with a Windows port of PERL.

http://groups.google.com/group/microsoft.public.windowsxp.general/msg/d2f219ff7ad54256?dmode=source

A fairly simple program allows you to create maximum name length files.
There is one length, which Explorer won't touch, and that is the crux
of the problem. And yet, PERL doesn't have the same limitation. I could
make a file which could not be deleted, then use PERL to rename the file
to something shorter, after which it could be deleted.

There is some kind of music classification system, which relies on making
files with huge names, and that is one source of files of that type.

Paul
 
J

Jeff Layman

OK, finally got rid of it! Contrary to Twayne's observation, there was
a lot of good help here. I ended up using MoveOnBoot to get rid of it.
Worked like a charm.

Unlocker did not even want to install properly!

Eraser and LockHunter both said that everything was fine and that the
folder(s) were not locked, but still wouldn't let me delete them.

RED didn't even come close to being what I needed.

MoveOnBoot worked! Just ran the wizard, selected the folder, re-booted
and 'yahoo' it was gone.

I still wish I knew what had screwed with that folder to cause this
much grief? Just glad it's gone. Thank you all for the help. Mucho
appreciated.
Thanks for the feedback. Good to know that one of them worked. FWIW, I
used Eraser for years with XP and it worked well, but didn't like Win7
x64 so much. LockHunter was better, but not perfect. Both usually
worked when deleting on reboot.

MoveOnBoot was usually successful on allowing deletion after moving.
Sometimes any of these utilities would fail if several files and folders
were selected for action - there seems to be a finite time in which they
work before the offending program hooks into the files, and stops
further deletion.

Remember that if all else fails, a Linux live CD will allow you to
delete just about anything on a Windows setup.
 
J

Jeff Layman

People keep recommending utilities of this kind. In all my decades of
using PCs, I've never needed anything of the kind. It makes me wonder
what people are doing these days that gets them into situations where
they (think they) need them.
Just reading this thread shows that there are quite a few people who
have this problem. Just out of interest, I googled "windows" and
"locked files". 2 million hits; same with "Linux" and "locked files",
584000 hits. So it's not exactly unknown.
Usually, if a file resists being deleted, it's because it's in use by
another program. All you have to do is get that program to release the
file, and that will be the end of it.
If it was that simple there wouldn't be a need to create these
utilities. And as it's often explorer.exe holding onto the file, how to
you get that to release the file without stopping the process and
screwing up Win7? And when it restarts it grabs on again! Even if it's
not explorer.exe, you would need to use something like those utilities
to find out exactly what program is locking those files, and once you do
that, why not use them to deal with the situation anyway?

I first used Eraser to deal with index.dat in XP, and even then it
wasn't easy (much more difficult in Win7 - Eraser fails, even on
reboot). I still cannot understand why that file is so tightly held by
Windows. It wasn't so much that it held all the browsing history even
after I'd deleted the temp files, but that the damn thing had got to
over 4Mb in size and was still growing. Anyway, now I use FF it isn't a
problem. :)
 
T

The Seabat

Yeah I checked that Joe. The folder was located in several different
(albeit same) locations, but I could not delete any of them. I kept
getting the "Can't find the file" warnings.
 
T

The Seabat

Yeah, I have a copy of Puppy that I could have dropped into the drive,
but didn't even think about it until after the files were gone. Will
have to make a mental note about that. I do appreciate all the help.
Thank you all.
 
T

Twayne

In
The Seabat said:
OK, finally got rid of it! Contrary to Twayne's
observation, there was a lot of good help here. I ended
up using MoveOnBoot to get rid of it. Worked like a charm.

Unlocker did not even want to install properly!

Eraser and LockHunter both said that everything was fine
and that the folder(s) were not locked, but still
wouldn't let me delete them.

RED didn't even come close to being what I needed.

MoveOnBoot worked! Just ran the wizard, selected the
folder, re-booted and 'yahoo' it was gone.

I still wish I knew what had screwed with that folder to
cause this much grief? Just glad it's gone. Thank you all
for the help. Mucho appreciated.
Take over Ownership. For your sake, I hope they're actually files and not
internal junction points, etc. as you could be rudely surprised. Keep track
of what you do so you might be able to put things back if the machine keeps
running OK.

Some names and information on the system would have helped a lot.
 
T

The Seabat

If you read my earlier posts you will see that I already had tried
that. No joy! And they were not files, they were as stated 'folders'.

Of what use would any other system info be? This was not a hardware
problem, just an OS problem.
 
T

Twayne

In
The Seabat said:
If you read my earlier posts you will see that I already
had tried that. No joy! And they were not files, they
were as stated 'folders'.

Of what use would any other system info be? This was not
a hardware problem, just an OS problem.
Were they simply junction points or one of the other link/file/folder
appearing genre?

It is your responsbility to see that pertinent information is kept with your
posts. For most, once a mail is read, it's no longer listed nor available
quickly and is not a job I will do for you.

Other system info that may help you would be the names of the relevant
files/folders and full paths. If they are "owned" by the system, nothing you
can do except taking ownership wiil allow you to delete them. If they're
owned by the system and you don't know it, that could be the end of your OS
functioning properly. I can show you dozens of files that meet your poorly
stated criteria and yet will damage or even trash your OS, or minimum will
seem to suddenly make some other things unavailable to you.
Since you can't be bothered to answer all the questions you've already
been asked, I'm no longer interested in the pleasure of knowing what is
causing your problems. I would suggest a little research to figure out
exactly what those files/folder might be.
In parting, can you see them using the Command Prompt window?
 
D

DanS

OK, finally got rid of it! Contrary to Twayne's
observation, there was a lot of good help here. I ended up
using MoveOnBoot to get rid of it. Worked like a charm.

Unlocker did not even want to install properly!

Eraser and LockHunter both said that everything was fine
and that the folder(s) were not locked, but still wouldn't
let me delete them.

RED didn't even come close to being what I needed.

MoveOnBoot worked! Just ran the wizard, selected the
folder, re-booted and 'yahoo' it was gone.

I still wish I knew what had screwed with that folder to
cause this much grief? Just glad it's gone. Thank you all
for the help. Mucho appreciated.
Just to add another 'trick' in case you run into this again, if
you open a command prompt, and CD to teh parent of the offending
folders/files and issue a: dir /x (or is it -x) you will be
presented with a list of files and folders, and one column will
also contain that file/folders "real" 8.3 name. You can then try
using the 8.3 name and delete (file) or rd (folder) from the
command prompt there.
 
Joined
May 28, 2020
Messages
2
Reaction score
1
If you cannot delete a folder then it might be because of long path file or long filename. You can easily solve it by using LongPathTool. Thank you.
 
Joined
Sep 13, 2024
Messages
2
Reaction score
0
If you cannot delete a folder because of a long path file. Try using the long path tool it works perfectly.
 

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