PC Review


Reply
Thread Tools Rate Thread

Cannot delete very deep directory tree

 
 
tedbaab@gmail.com
Guest
Posts: n/a
 
      28th Aug 2007
Hi everyone, I have an unusual problem:

I have a directory that I cannot delete that was created by an
accidental backup routine. I have a folder on my K drive called "K:
\projects 2007" with about 89mb (3 folders) in in, which was copied by
my automated backup (Cobian Backup) into its own directory "K:
\projects 2007", creating a loop that nested "projects 2007" folders
into themselves, presumably with about 89mb in each tier. Creating:

K:\projects 2007\projects 2007\projects 2007\projects 2007\projects
2007\projects 2007...

I do not know how deep the directory structure goes, but by the space
left on my disk, it looks to be about 433 directories deep (for a
total disk usage of about 39GB)! My goal is to delete the whole thing.

I cannot delete, it says "Cannot Delete File or Folder, Cannot Delete
File:".

I have tried:

1) Going down as far as I can and trying to delete that folder. Same
problem, presumably because I am only like 18 levels down, which
barely scratches the surface! Explorer will only let me browse that
far.

2) Terminating explorer and browsing from within Nero to delete the
folder, or a deeper one within it. It only lets me browse down to like
18 tiers anyway.

3) using the Command Prompt, after having terminated explorer, and
from safe mode to rmdir /s the directory. I have also tried the rd
command. Both successfully bury through an impressive number of
directories, but return lots of errors like "Maximum Path Length
Exceeded", "The process cannot access the file because it is being
used by another process" (even from safe mode), "The directory is not
empty", etc etc

4) Browsing down as far as I could go (again, like 18 tiers), then
mapping that folder to a new virtual drive, then browsing down in that
virtual drive, then mapping a deeper drive, etc. I used all 26 letters
and was able to browse deeper, but I get the same error when I try to
delete a folder.

5) I have tried numerous "Delete on Boot" programs to attempt to
delete the folder on reboot, when nothing was accessing it.

Any thoughts or suggestions short of clearing off the drive and
formatting, would be much appreciated!

Thanks again

Ted

 
Reply With Quote
 
 
 
 
John John
Guest
Posts: n/a
 
      28th Aug 2007
Try using the SUBST command to shorten the path or map it to a network
share then try to delete it.

John

(E-Mail Removed) wrote:
> Hi everyone, I have an unusual problem:
>
> I have a directory that I cannot delete that was created by an
> accidental backup routine. I have a folder on my K drive called "K:
> \projects 2007" with about 89mb (3 folders) in in, which was copied by
> my automated backup (Cobian Backup) into its own directory "K:
> \projects 2007", creating a loop that nested "projects 2007" folders
> into themselves, presumably with about 89mb in each tier. Creating:
>
> K:\projects 2007\projects 2007\projects 2007\projects 2007\projects
> 2007\projects 2007...
>
> I do not know how deep the directory structure goes, but by the space
> left on my disk, it looks to be about 433 directories deep (for a
> total disk usage of about 39GB)! My goal is to delete the whole thing.
>
> I cannot delete, it says "Cannot Delete File or Folder, Cannot Delete
> File:".
>
> I have tried:
>
> 1) Going down as far as I can and trying to delete that folder. Same
> problem, presumably because I am only like 18 levels down, which
> barely scratches the surface! Explorer will only let me browse that
> far.
>
> 2) Terminating explorer and browsing from within Nero to delete the
> folder, or a deeper one within it. It only lets me browse down to like
> 18 tiers anyway.
>
> 3) using the Command Prompt, after having terminated explorer, and
> from safe mode to rmdir /s the directory. I have also tried the rd
> command. Both successfully bury through an impressive number of
> directories, but return lots of errors like "Maximum Path Length
> Exceeded", "The process cannot access the file because it is being
> used by another process" (even from safe mode), "The directory is not
> empty", etc etc
>
> 4) Browsing down as far as I could go (again, like 18 tiers), then
> mapping that folder to a new virtual drive, then browsing down in that
> virtual drive, then mapping a deeper drive, etc. I used all 26 letters
> and was able to browse deeper, but I get the same error when I try to
> delete a folder.
>
> 5) I have tried numerous "Delete on Boot" programs to attempt to
> delete the folder on reboot, when nothing was accessing it.
>
> Any thoughts or suggestions short of clearing off the drive and
> formatting, would be much appreciated!
>
> Thanks again
>
> Ted
>


 
Reply With Quote
 
=?Utf-8?B?ampqZGF2aWRzb24=?=
Guest
Posts: n/a
 
      28th Aug 2007
Can you rename the folders? If so, you could try a batch job like:

set kren=k:
:loop-awhile
rename "%kren%\projects 2007" "%kren%\k"
set kren=%kren%\k
goto loop-awhile

This might eventually shorten the total path name enough that Windows can
deal with it.

"(E-Mail Removed)" wrote:

> Hi everyone, I have an unusual problem:
>
> I have a directory that I cannot delete that was created by an
> accidental backup routine. I have a folder on my K drive called "K:
> \projects 2007" with about 89mb (3 folders) in in, which was copied by
> my automated backup (Cobian Backup) into its own directory "K:
> \projects 2007", creating a loop that nested "projects 2007" folders
> into themselves, presumably with about 89mb in each tier. Creating:
>
> K:\projects 2007\projects 2007\projects 2007\projects 2007\projects
> 2007\projects 2007...
>
> I do not know how deep the directory structure goes, but by the space
> left on my disk, it looks to be about 433 directories deep (for a
> total disk usage of about 39GB)! My goal is to delete the whole thing.
>
> I cannot delete, it says "Cannot Delete File or Folder, Cannot Delete
> File:".
>
> I have tried:
>
> 1) Going down as far as I can and trying to delete that folder. Same
> problem, presumably because I am only like 18 levels down, which
> barely scratches the surface! Explorer will only let me browse that
> far.
>
> 2) Terminating explorer and browsing from within Nero to delete the
> folder, or a deeper one within it. It only lets me browse down to like
> 18 tiers anyway.
>
> 3) using the Command Prompt, after having terminated explorer, and
> from safe mode to rmdir /s the directory. I have also tried the rd
> command. Both successfully bury through an impressive number of
> directories, but return lots of errors like "Maximum Path Length
> Exceeded", "The process cannot access the file because it is being
> used by another process" (even from safe mode), "The directory is not
> empty", etc etc
>
> 4) Browsing down as far as I could go (again, like 18 tiers), then
> mapping that folder to a new virtual drive, then browsing down in that
> virtual drive, then mapping a deeper drive, etc. I used all 26 letters
> and was able to browse deeper, but I get the same error when I try to
> delete a folder.
>
> 5) I have tried numerous "Delete on Boot" programs to attempt to
> delete the folder on reboot, when nothing was accessing it.
>
> Any thoughts or suggestions short of clearing off the drive and
> formatting, would be much appreciated!
>
> Thanks again
>
> Ted
>
>

 
Reply With Quote
 
tedbaab@gmail.com
Guest
Posts: n/a
 
      28th Aug 2007
On Aug 28, 3:36 pm, jjjdavidson
<jjjdavid...@discussions.microsoft.com> wrote:
> Can you rename the folders? If so, you could try a batch job like:
>
> set kren=k:
> :loop-awhile
> rename "%kren%\projects 2007" "%kren%\k"
> set kren=%kren%\k
> goto loop-awhile
>
> This might eventually shorten the total path name enough that Windows can
> deal with it.
>
> "tedb...@gmail.com" wrote:
> > Hi everyone, I have an unusual problem:

>


davidson, that sounds like a great strategy. how would i go about
doing that? I am not so knowledgeable about batch files. I would also
need to run this either from safe mode, or from cmd with explorer shut
down since it says the folder is being used/accessed when i try to
rename a folder from explorer...




 
Reply With Quote
 
=?Utf-8?B?ampqZGF2aWRzb24=?=
Guest
Posts: n/a
 
      28th Aug 2007
Just copy and paste the code into a file named temp.bat or temp.cmd, then run
the file from the command line. Here's a slightly better version of the
script, with error checking.

set kren=k:
:loop-awhile
rename "%kren%\projects 2007" "%kren%\k"
if errorlevel 1 exit /b
set kren=%kren%\k
goto loop-awhile

If this works, but doesn't get you far enough, do a SUBST command and change
the K: in the first SET command to whatever letter you assign.

Good luck!

"(E-Mail Removed)" wrote:

> On Aug 28, 3:36 pm, jjjdavidson
> <jjjdavid...@discussions.microsoft.com> wrote:
> > Can you rename the folders? If so, you could try a batch job like:
> >
> > set kren=k:
> > :loop-awhile
> > rename "%kren%\projects 2007" "%kren%\k"
> > set kren=%kren%\k
> > goto loop-awhile
> >
> > This might eventually shorten the total path name enough that Windows can
> > deal with it.
> >
> > "tedb...@gmail.com" wrote:
> > > Hi everyone, I have an unusual problem:

> >

>
> davidson, that sounds like a great strategy. how would i go about
> doing that? I am not so knowledgeable about batch files. I would also
> need to run this either from safe mode, or from cmd with explorer shut
> down since it says the folder is being used/accessed when i try to
> rename a folder from explorer...
>
>
>
>
>

 
Reply With Quote
 
tedbaab@gmail.com
Guest
Posts: n/a
 
      28th Aug 2007
On Aug 28, 4:22 pm, jjjdavidson
<jjjdavid...@discussions.microsoft.com> wrote:
> Just copy and paste the code into a file named temp.bat or temp.cmd, then run
> the file from the command line. Here's a slightly better version of the
> script, with error checking.
>
> set kren=k:
> :loop-awhile
> rename "%kren%\projects 2007" "%kren%\k"
> if errorlevel 1 exit /b
> set kren=%kren%\k
> goto loop-awhile
>
> If this works, but doesn't get you far enough, do a SUBST command and change
> the K: in the first SET command to whatever letter you assign.
>
> Good luck!
>
> "tedb...@gmail.com" wrote:
> > On Aug 28, 3:36 pm, jjjdavidson
> > <jjjdavid...@discussions.microsoft.com> wrote:
> > > Can you rename the folders? If so, you could try a batch job like:

>
> > > set kren=k:
> > > :loop-awhile
> > > rename "%kren%\projects 2007" "%kren%\k"
> > > set kren=%kren%\k
> > > goto loop-awhile

>
> > > This might eventually shorten the total path name enough that Windows can
> > > deal with it.

>
> > > "tedb...@gmail.com" wrote:
> > > > Hi everyone, I have an unusual problem:

>
> > davidson, that sounds like a great strategy. how would i go about
> > doing that? I am not so knowledgeable about batch files. I would also
> > need to run this either from safe mode, or from cmd with explorer shut
> > down since it says the folder is being used/accessed when i try to
> > rename a folder from explorer...


davidson,
thanks for your quick reply and your explanation.

I tried the first script (without the error checking), and it did it
for a while (2033 times actually), before saying the input was too
large. But that at least means there are 2033 or more nested
directories. But for some reason, none of the directories that I can
browse from explorer had the names changed.

When I used your new script, it errored out immediately, and did not
complete one iteration.

am I stuck then?

Thanks again, you've been very helpful!

 
Reply With Quote
 
=?iso-8859-1?Q?_db_=B4=AF`=B7.._=3E=3C=29=29=29=BA
Guest
Posts: n/a
 
      28th Aug 2007
you might try uninstalling
cobian then trying to
delete that directory n files.

or try the delete them
via safemode.

or simply move out
whatever you can from
the k partition. then delete
the partition and recreate it
if you still need it.

--

db ·´¯`·.¸. , .
..·´¯`·..><)))º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><)))º>¸.
><)))º>·´¯`·.¸. , . .·´¯`·..
> ><)))º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><)))º>



..


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi everyone, I have an unusual problem:
>
> I have a directory that I cannot delete that was
> created by an
> accidental backup routine. I have a folder on my K
> drive called "K:
> \projects 2007" with about 89mb (3 folders) in in,
> which was copied by
> my automated backup (Cobian Backup) into its own
> directory "K:
> \projects 2007", creating a loop that nested
> "projects 2007" folders
> into themselves, presumably with about 89mb in each
> tier. Creating:
>
> K:\projects 2007\projects 2007\projects 2007\projects
> 2007\projects
> 2007\projects 2007...
>
> I do not know how deep the directory structure goes,
> but by the space
> left on my disk, it looks to be about 433 directories
> deep (for a
> total disk usage of about 39GB)! My goal is to delete
> the whole thing.
>
> I cannot delete, it says "Cannot Delete File or
> Folder, Cannot Delete
> File:".
>
> I have tried:
>
> 1) Going down as far as I can and trying to delete
> that folder. Same
> problem, presumably because I am only like 18 levels
> down, which
> barely scratches the surface! Explorer will only let
> me browse that
> far.
>
> 2) Terminating explorer and browsing from within Nero
> to delete the
> folder, or a deeper one within it. It only lets me
> browse down to like
> 18 tiers anyway.
>
> 3) using the Command Prompt, after having terminated
> explorer, and
> from safe mode to rmdir /s the directory. I have also
> tried the rd
> command. Both successfully bury through an impressive
> number of
> directories, but return lots of errors like "Maximum
> Path Length
> Exceeded", "The process cannot access the file
> because it is being
> used by another process" (even from safe mode), "The
> directory is not
> empty", etc etc
>
> 4) Browsing down as far as I could go (again, like 18
> tiers), then
> mapping that folder to a new virtual drive, then
> browsing down in that
> virtual drive, then mapping a deeper drive, etc. I
> used all 26 letters
> and was able to browse deeper, but I get the same
> error when I try to
> delete a folder.
>
> 5) I have tried numerous "Delete on Boot" programs to
> attempt to
> delete the folder on reboot, when nothing was
> accessing it.
>
> Any thoughts or suggestions short of clearing off the
> drive and
> formatting, would be much appreciated!
>
> Thanks again
>
> Ted
>


 
Reply With Quote
 
=?Utf-8?B?ampqZGF2aWRzb24=?=
Guest
Posts: n/a
 
      28th Aug 2007
The first version errored out when the command string got too long for DOS to
manage, not when it ran out of folders to rename; that's why I added the
error check. Toward the end, were you getting "system cannot find the path"
or "filename is too long"?

The second version errored out immediately because it assumes the first path
is still named "projects 2007" and (hopefully) some of the upper levels had
already been renamed. Either that, or my original RENAME command was bad.
Check that the folder name is spelled correctly, and such like.

Does the original folder still appear when you type DIR K:\ at the command
prompt? If the original "projects 2007" folder still exists, there was a
problem with the original rename. If it's been renamed to K:\K, then at
least the upper-level renames worked.

If the top-level folder is still there, can you rename it manually?

"(E-Mail Removed)" wrote:

> On Aug 28, 4:22 pm, jjjdavidson
> <jjjdavid...@discussions.microsoft.com> wrote:
> > Just copy and paste the code into a file named temp.bat or temp.cmd, then run
> > the file from the command line. Here's a slightly better version of the
> > script, with error checking.
> >
> > set kren=k:
> > :loop-awhile
> > rename "%kren%\projects 2007" "%kren%\k"
> > if errorlevel 1 exit /b
> > set kren=%kren%\k
> > goto loop-awhile
> >
> > If this works, but doesn't get you far enough, do a SUBST command and change
> > the K: in the first SET command to whatever letter you assign.
> >
> > Good luck!
> >
> > "tedb...@gmail.com" wrote:
> > > On Aug 28, 3:36 pm, jjjdavidson
> > > <jjjdavid...@discussions.microsoft.com> wrote:
> > > > Can you rename the folders? If so, you could try a batch job like:

> >
> > > > set kren=k:
> > > > :loop-awhile
> > > > rename "%kren%\projects 2007" "%kren%\k"
> > > > set kren=%kren%\k
> > > > goto loop-awhile

> >
> > > > This might eventually shorten the total path name enough that Windows can
> > > > deal with it.

> >
> > > > "tedb...@gmail.com" wrote:
> > > > > Hi everyone, I have an unusual problem:

> >
> > > davidson, that sounds like a great strategy. how would i go about
> > > doing that? I am not so knowledgeable about batch files. I would also
> > > need to run this either from safe mode, or from cmd with explorer shut
> > > down since it says the folder is being used/accessed when i try to
> > > rename a folder from explorer...

>
> davidson,
> thanks for your quick reply and your explanation.
>
> I tried the first script (without the error checking), and it did it
> for a while (2033 times actually), before saying the input was too
> large. But that at least means there are 2033 or more nested
> directories. But for some reason, none of the directories that I can
> browse from explorer had the names changed.
>
> When I used your new script, it errored out immediately, and did not
> complete one iteration.
>
> am I stuck then?
>
> Thanks again, you've been very helpful!
>
>

 
Reply With Quote
 
Poprivet
Guest
Posts: n/a
 
      28th Aug 2007
(E-Mail Removed) wrote:
> Hi everyone, I have an unusual problem:
>
> I have a directory that I cannot delete that was created by an
> accidental backup routine. I have a folder on my K drive called "K:
> \projects 2007" with about 89mb (3 folders) in in, which was copied by
> my automated backup (Cobian Backup) into its own directory "K:
> \projects 2007", creating a loop that nested "projects 2007" folders
> into themselves, presumably with about 89mb in each tier. Creating:
>
> K:\projects 2007\projects 2007\projects 2007\projects 2007\projects
> 2007\projects 2007...
>
> I do not know how deep the directory structure goes, but by the space
> left on my disk, it looks to be about 433 directories deep (for a
> total disk usage of about 39GB)! My goal is to delete the whole thing.
>
> I cannot delete, it says "Cannot Delete File or Folder, Cannot Delete
> File:".
>
> I have tried:
>
> 1) Going down as far as I can and trying to delete that folder. Same
> problem, presumably because I am only like 18 levels down, which
> barely scratches the surface! Explorer will only let me browse that
> far.
>
> 2) Terminating explorer and browsing from within Nero to delete the
> folder, or a deeper one within it. It only lets me browse down to like
> 18 tiers anyway.
>
> 3) using the Command Prompt, after having terminated explorer, and
> from safe mode to rmdir /s the directory. I have also tried the rd
> command. Both successfully bury through an impressive number of
> directories, but return lots of errors like "Maximum Path Length
> Exceeded", "The process cannot access the file because it is being
> used by another process" (even from safe mode), "The directory is not
> empty", etc etc
>
> 4) Browsing down as far as I could go (again, like 18 tiers), then
> mapping that folder to a new virtual drive, then browsing down in that
> virtual drive, then mapping a deeper drive, etc. I used all 26 letters
> and was able to browse deeper, but I get the same error when I try to
> delete a folder.
>
> 5) I have tried numerous "Delete on Boot" programs to attempt to
> delete the folder on reboot, when nothing was accessing it.
>
> Any thoughts or suggestions short of clearing off the drive and
> formatting, would be much appreciated!
>
> Thanks again
>
> Ted


Since this is K drive, presumably NOT your boot drive, then just copy
everything BUT that folder set to another drive. Then kill, recreate the
partition, and put things back. Done, quicker, and more efficiently.

AND, if that program can't handle recursing itself, I'd get rid of it and
install one that can! That's an unforgiveable bug, IMO. Any good app knows
not to recurse itself.

If you're doing that with batch files, XXCOPY will handle that sort of
recursivity very well and easily. It's at xxcopy.com. Very similar to
xcopy but much more powerful. Oh, and it's free but I found it so useful I
paid for it. Only difference between paid/free is a license, which stops
certain nags and turns on a few very powerful features. It'll also clone a
drive; has both backup and clone features. NOT for backing up system
drives; you need to use shadowcopy for that. It's all in their FAQs.

HTH

Pop`


 
Reply With Quote
 
Plato
Guest
Posts: n/a
 
      29th Aug 2007
(E-Mail Removed) wrote:
>
> I have a directory that I cannot delete that was created by an
> accidental backup routine. I have a folder on my K drive called "K:


http://www.bootdisk.com/utility.htm
GENERAL FILE UTILITIES
Stubborn File Deleters


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete deep directory hierarchy Mário Windows Vista General Discussion 5 11th Mar 2010 09:43 AM
How to View Windows Explorer Directory Tree from Outlook Tree? =?Utf-8?B?S2F0ZSBHIDgz?= Microsoft Outlook Discussion 1 26th Aug 2007 05:35 AM
Deep Net Directory Frank Bohan Freeware 1 22nd Jan 2006 08:34 PM
Looking for a way to push and sync a directory tree to another directory. Al Dykes Windows XP General 2 19th Apr 2005 06:34 PM
Display directory tree when Windows Explorer starts up in a specified directory Charles Rogers Windows XP General 4 20th Dec 2004 09:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:23 AM.