Welcome Guest.   Make a donation to an author on the site October 22, 2014, 07:03:52 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
View the new Member Awards and Badges page.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: How can I delete over 6,000 recursive directories?  (Read 6025 times)
Jammo the OrganizedFellow
Supporting Member
**
Posts: 212


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« on: June 01, 2011, 04:17:25 PM »

Around 3-4 months ago, my wifes phone (Motorola Defy) suddenly slowed to a pathetic crawl.
It would take forever to accomplish anything. She didn't know why, but I suspected some rogue app.
I forget all the steps I took to isolate the condition, but I found that the camera would store every photo in its own directory. Plus it did the same for thumbnails.
Long terrible situation > short ... her phone no longer works.
Now, at this time, she only had her phone for about 4-5 months. TOPS!!!
She used the camera regularly, nothing outrageous.
I made a backup of her 8GB microSD card.
It was filled to the max!
WTF?

I ran Microsoft Security Essentials on this backup folder.
When it finished, it reported no issues. But it DID scan 12,408 directories.
FRIGGIN' CRAZY, RIGHT??!??!
The attached screenshot is about half way through the scan.

What's REALLY odd, I was able to delete all the photos. But the empty folders are still there.

So my question: how can I delete all these folders?


* 6000_camera_directories.png (323.78 KB, 797x560 - viewed 177 times.)
Logged

As an aspiring web developer/designer, it is a constant struggle to cope with my ADHD + Hypomania/Bipolar Disorder.

The slow growth of my web dev projects is eclipsed by my patience, understanding and desire to learn AS MUCH AS POSSIBLE as I slowly progress.

X_____jamjammo_____
MilesAhead
Member
**
Posts: 4,941



View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: June 01, 2011, 04:27:50 PM »

Is there any software on the card?  If it's just storage, find out how to format it.  That will delete everything.
Logged

"Genius is not knowing you can't do it that way."
- MilesAhead
rjbull
Charter Member
***
Posts: 2,776

View Profile Give some DonationCredits to this forum member
« Reply #2 on: June 01, 2011, 04:28:15 PM »

DelAge32, freeware by Horst Schaeffer.
Quote
DelAge32 is a command line tool that deletes or moves files by age (number of days).
[...]
/recurse   Recurse through the entire subdirectory structure (see /rd option to remove empty directories)
/subonly   Recurse, but exclude the initial directory   
/rd   Remove empty directories by age (according to "created" stamp)   
[...]
Logged
Jammo the OrganizedFellow
Supporting Member
**
Posts: 212


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: June 01, 2011, 04:31:54 PM »

Is there any software on the card?  If it's just storage, find out how to format it.  That will delete everything.

The phone no longer works. Getting it functional is beyond my intents.
The microSD card is still in the phone.

I'm wanting to delete the backed up folders from my PC.
It's spring cleaning time, and I came across them today.

@rjbull: thank you. I'll give that a try.
Logged

As an aspiring web developer/designer, it is a constant struggle to cope with my ADHD + Hypomania/Bipolar Disorder.

The slow growth of my web dev projects is eclipsed by my patience, understanding and desire to learn AS MUCH AS POSSIBLE as I slowly progress.

X_____jamjammo_____
Jammo the OrganizedFellow
Supporting Member
**
Posts: 212


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: June 01, 2011, 05:27:31 PM »

NOPE.
I extracted the contents of "delage32.zip" to a temp directory. And ran my first command:
Delage32 D:\MomPhoneBackup\*.* 10 /recurse /rd

*I didn't know if it would delete anything/everything YOUNGER or OLDER than 10 days.
So I ran it a few times with 10, 100, 1000, etc. You get the picture.

OUTPUT
[copy or print]
D:\_TEMP\delage32>Delage32 D:\MomPhoneBackup\*.* 10 /recurse /rd
 (rd) 110327_112728\dcim\b\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camer
a\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\ *** fail
ed ***
DelAge32 - No files

D:\_TEMP\delage32>

*I didn't know ... I didn't read the directions fully till my first few attempts because I wasn't paying attention and ended up watching a movie and having lunch ... because I got distracted.
But I tried a few more times and all come up with the same results.
Logged

As an aspiring web developer/designer, it is a constant struggle to cope with my ADHD + Hypomania/Bipolar Disorder.

The slow growth of my web dev projects is eclipsed by my patience, understanding and desire to learn AS MUCH AS POSSIBLE as I slowly progress.

X_____jamjammo_____
Curt
Supporting Member
**
Posts: 6,338

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #5 on: June 01, 2011, 05:38:23 PM »

Empty Folder Nuker by Simon Wai
Logged
Jammo the OrganizedFellow
Supporting Member
**
Posts: 212


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #6 on: June 01, 2011, 05:44:35 PM »

Thanks Curt.

I'll give that a shot.
Logged

As an aspiring web developer/designer, it is a constant struggle to cope with my ADHD + Hypomania/Bipolar Disorder.

The slow growth of my web dev projects is eclipsed by my patience, understanding and desire to learn AS MUCH AS POSSIBLE as I slowly progress.

X_____jamjammo_____
Krishean
Honorary Member
**
Posts: 75



I like pie

View Profile WWW Give some DonationCredits to this forum member
« Reply #7 on: June 01, 2011, 05:56:41 PM »

tried this command?

rmdir /S /Q dirnamehere

i have also seen too many nested directories cause filesystem damage
Logged

Any sufficiently advanced technology is indistinguishable from magic.

- Arthur C. Clarke
Jammo the OrganizedFellow
Supporting Member
**
Posts: 212


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: June 01, 2011, 05:57:35 PM »

another NOPE.
It doesn't even show the directories.

To make sure I was using it right, I made a bunch of embedded directories, and ran the app.
It showed and removed those with no problem.
Logged

As an aspiring web developer/designer, it is a constant struggle to cope with my ADHD + Hypomania/Bipolar Disorder.

The slow growth of my web dev projects is eclipsed by my patience, understanding and desire to learn AS MUCH AS POSSIBLE as I slowly progress.

X_____jamjammo_____
Stoic Joker
Honorary Member
**
Posts: 5,326



View Profile WWW Give some DonationCredits to this forum member
« Reply #9 on: June 01, 2011, 06:17:51 PM »

Have you made sure you have the necessary permissions for the directories in question? Taken ownership of them etc.?

rmdir /S /Q dirnamehere

hehe Been awhile since I've had to use that one for anything. It might not hurt to try this also:

rmdir /Q /S \\.\C:\Target_Folder

Had to use that on a few hidden directory FTP server cleanups (back in the day).
Logged
40hz
Supporting Member
**
Posts: 10,728



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: June 01, 2011, 06:19:05 PM »

+1 with Krishean.

I've also seen too many nested directories (or too long a path) screw up a file system beyond repair.

Your best bet might be to just copy over anything you still want and then reformat the SD card.

Luck! Thmbsup
Logged

Don't you see? It's turtles all the way down!
Jammo the OrganizedFellow
Supporting Member
**
Posts: 212


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #11 on: June 01, 2011, 07:07:13 PM »

Your best bet might be to just copy over anything you still want and then reformat the SD card.

Luck! Thmbsup
I have already DONE that.
The card has since remained IN the phone. I'm not worried at ALL about the condition of the card nor the phone.

I'm asking for help to remove these items from their BACKUP LOCATION on my PC. por favor tongue


Everything I've been recommended to do above has been done, with no effect to anything.
----- ----- ----- ----- -----

[copy or print]
D:\MomPhoneBackup\dcim\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\Camera\

That's where I was a few hours ago.
Everything attempted via command line results with a message about the filename being too long.
So I've manually gone and done this:

[copy or print]
D:\MomPhoneBackup\1\2\3\4\5\6\7\8\9\0\1\2\3\4\5\6\7\8\9\0\1\2\3\4\5\6\7\8\9\0\1\2\3\4\5\6\7\8\9\0\1\2\3\4\5\6\7\8\9\0\1\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\Camera\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\33\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\1>

Now all the above directories are EMPTY.
I am renaming all "/Camera/" folders to single-digits. Each Camera folder has ninety-something JPG files in them.

Using the above mentioned command: "rmdir /S /Q dirnamehere" does nothing.
Then I started renaming the "/Camera/" folders and deleting the photos: del *.jpg

I've got (I lost count) X folders deep, and now my commands say:
The system cannot find the path specified.
The file name is too long.

----- ----- ----- ----- -----

I'm currently in a folder and can not delete any photos, nor can I rename the Camera folder.
This is proving to be a real pain in the butt.
Logged

As an aspiring web developer/designer, it is a constant struggle to cope with my ADHD + Hypomania/Bipolar Disorder.

The slow growth of my web dev projects is eclipsed by my patience, understanding and desire to learn AS MUCH AS POSSIBLE as I slowly progress.

X_____jamjammo_____
Target
Honorary Member
**
Posts: 1,408



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #12 on: June 01, 2011, 07:22:06 PM »

can you delete from the bottom up?

if you can delete 1, try 5, then 10, etc and see if you can get it down to something reasonable

Logged

"Look wise, say nothing, and grunt. Speech was given to conceal thought" - Sir William Osler
Jammo the OrganizedFellow
Supporting Member
**
Posts: 212


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #13 on: June 01, 2011, 07:32:12 PM »

can you delete from the bottom up?

if you can delete 1, try 5, then 10, etc and see if you can get it down to something reasonable


I'e tried that at the root of the folder, middle, and at the end.
At the end, where the last Camera folder is at, and also where the photo files are, I'm not able to delete them.

When I try to delete them via command line, it says: The system cannot find the path specified.
When I try to delete them via Explorer window, it says: The name(s) were too long for the destination folder. You can shorten the file name and try again.

That's why I renamed all the original '/Camera/' folders to single numerals.
It actually DID help, as I was able to navigate further than before.

I'm stuck now, because all I've tried no longer works.
Logged

As an aspiring web developer/designer, it is a constant struggle to cope with my ADHD + Hypomania/Bipolar Disorder.

The slow growth of my web dev projects is eclipsed by my patience, understanding and desire to learn AS MUCH AS POSSIBLE as I slowly progress.

X_____jamjammo_____
Target
Honorary Member
**
Posts: 1,408



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #14 on: June 01, 2011, 07:48:58 PM »

what about booting into a live rescue or linux distro?

I'm not a Linux user (too lazy) but isn't this the sort of thing they're meant for?
Logged

"Look wise, say nothing, and grunt. Speech was given to conceal thought" - Sir William Osler
40hz
Supporting Member
**
Posts: 10,728



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: June 01, 2011, 08:05:54 PM »

I'm asking for help to remove these items from their BACKUP LOCATION on my PC. por favor

Sorry. Must have missed that part.  embarassed


what about booting into a live rescue or linux distro?

I'm not a Linux user (too lazy) but isn't this the sort of thing they're meant for?

Yes they are. Any 'live' Linux distro will work. It doesn't have to be a rescue release. The file manager in Puppy or one of the mini distros should work equally well. I've done that when a Macintosh directory was copied onto an external HD, and Windows Explorer and the command line couldn't delete certain files because the path/name was too long; or contained a character not allowed (e.g. / \ * etc.) under Windows. PartedMagic is a good Swiss Army type utility disk to have for this sort of thing.

 Thmbsup
« Last Edit: June 01, 2011, 08:18:15 PM by 40hz » Logged

Don't you see? It's turtles all the way down!
Target
Honorary Member
**
Posts: 1,408



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #16 on: June 01, 2011, 08:15:43 PM »

Yes they are. Any 'live' Linux distro will work. It doesn't have to be a rescue release. The file manager in Puppy or one of the mini distros should work equally well.

yeah, I figured as much, though I thought a rescue distro may make the process easier (by including appropriate ready to use apps)

Quote
PartedMagic is a good Swiss Army type utility disk to have for this sort of thing.

Parted Magic does file operations?
Logged

"Look wise, say nothing, and grunt. Speech was given to conceal thought" - Sir William Osler
40hz
Supporting Member
**
Posts: 10,728



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #17 on: June 01, 2011, 08:22:38 PM »

PartedMagic[/b] is a good Swiss Army type utility disk to have for this sort of thing.
Quote
Parted Magic does file operations?

Latest version has a bunch of file tools including PCManFM.  Above link goes to a page with full details.  Check it out. It's not your granddaddy's Parted Magic CD!  Grin  Thmbsup

« Last Edit: June 01, 2011, 08:27:55 PM by 40hz » Logged

Don't you see? It's turtles all the way down!
Target
Honorary Member
**
Posts: 1,408



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #18 on: June 01, 2011, 08:31:00 PM »

Latest version has a bunch of file tools including PCManFM.  Above link goes to a page with full details.  Check it out. It's not your granddaddy's Parted Magic CD!  Grin  Thmbsup

cool - I've had copies of this in my toolkit for years, though I rarely have a need for it so it doesn't get updated that often (it's been quite a while Thmbsup)
Logged

"Look wise, say nothing, and grunt. Speech was given to conceal thought" - Sir William Osler
MilesAhead
Member
**
Posts: 4,941



View Profile WWW Give some DonationCredits to this forum member
« Reply #19 on: June 01, 2011, 10:01:05 PM »

I haven't tried this script.  But you can take a look:

http://www.sevenforums.co...enance/29234-deltree.html
Logged

"Genius is not knowing you can't do it that way."
- MilesAhead
lanux128
Global Moderator
*****
Posts: 6,108



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #20 on: June 02, 2011, 12:18:44 AM »

try this and see if it helps, Remove Empty Directories aka RED.



http://www.jonasjohn.de/lab/red.htm
Logged

Jammo the OrganizedFellow
Supporting Member
**
Posts: 212


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #21 on: June 02, 2011, 01:06:28 AM »

I'm not able to boot to a LiveCD because the last time I tried one, I couldn't use my wireless Logitech keyboard.
I'm sure I would have to be hard-wired in, right? Is that the right term?

I tried this http://www.jonasjohn.de/lab/red.htm posted by lanux128.
It didn't work.

MilesAhead posted this http://www.sevenforums.co...enance/29234-deltree.html
I'm not comfortable playing with a VB script Sad
----- ----- ----- ----- -----
"You can download Ubuntu and run it alongside your current Windows system."

So I'm gonna give it a shot.
It's supposed to be as easy as installing and uninstalling a Windows app.


I've played with Ubuntu years years ago.
It was always pretty good at detecting my hardware. I just hope it's still as good smiley

I'll report back.
« Last Edit: June 02, 2011, 01:08:48 AM by Jammo the OrganizedFellow » Logged

As an aspiring web developer/designer, it is a constant struggle to cope with my ADHD + Hypomania/Bipolar Disorder.

The slow growth of my web dev projects is eclipsed by my patience, understanding and desire to learn AS MUCH AS POSSIBLE as I slowly progress.

X_____jamjammo_____
Jammo the OrganizedFellow
Supporting Member
**
Posts: 212


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #22 on: June 02, 2011, 01:41:48 AM »

SUCCESS!!!!!!!!!!!!!!!!!

As I've used Ubuntu in the past, I've also used EasyBCD http://neosmart.net/dl.php?id=1
and I'm pretty sure that all I really needed was iReboot http://neosmart.net/dl.php?id=11

I've rebooted into Ubuntu (I feel right at home) and knew instantly where to go to delete that damned directory.
cheesy tongue smiley

THANK YOU for the recommendations fellas!!!
« Last Edit: June 02, 2011, 05:16:29 PM by Jammo the OrganizedFellow » Logged

As an aspiring web developer/designer, it is a constant struggle to cope with my ADHD + Hypomania/Bipolar Disorder.

The slow growth of my web dev projects is eclipsed by my patience, understanding and desire to learn AS MUCH AS POSSIBLE as I slowly progress.

X_____jamjammo_____
rjbull
Charter Member
***
Posts: 2,776

View Profile Give some DonationCredits to this forum member
« Reply #23 on: June 02, 2011, 04:31:32 PM »

NOPE.
I extracted the contents of "delage32.zip" to a temp directory. And ran my first command:
Delage32 D:\MomPhoneBackup\*.* 10 /recurse /rd
[...]
DelAge32 - No files
[...]
But I tried a few more times and all come up with the same results.

It's meant for deleting files over a given age.  You may need to wrap the path in double quotes, if the path has spaces in it.  I.e.,

D:\Here it is\*.*

would probably fail, but

"D:\Here it is\*.*"

should work (I think).  I certainly had to use quotes round UNC paths.  You may also have run into a command line that's just too long for Windows/DOS to accept: there's a limit, though I can't remember just what it is.

Examples of command lines that worked for me:
[copy or print]
c:\dos\utils\delage32 g:\pcw\bak\*.7z 60
Straightforward, there isn't a space in the path
[copy or print]
c:\dos\utils\delage32 "\\GBRCSFBZ001\Groups\Technical\Library\Newsletter\Newsletter_*.pdf" 60
with UNC path
[copy or print]
c:\dos\utils\delage32.exe "c:\Documents and Settings\robertbull\Local Settings\Temp\ev_client_log_*.txt" 1 /includeRO /includeH /quiet
both worked, and that last one does have spaces in the path.  I used these examples in batch files for automated clean-ups, using PowerPro's scheduler.

Another thought; shouldn't most file managers do what you want without fuss?  Total Commander certainly will.  You have to press OK the first time if it thinks there's something inside the top-level directory you're deleting, including empty child directories, but only the once.  It isn't free as delage32 is, but it's modestly priced, and one of the best-value file managers out there, as well as one of the very best file managers anywhere.  It was the first thing that made using Windows almost semi-tolerable for this old-time DOS person.
Logged
MilesAhead
Member
**
Posts: 4,941



View Profile WWW Give some DonationCredits to this forum member
« Reply #24 on: June 02, 2011, 04:47:55 PM »

Here's the MS way to do it from command line:

http://support.microsoft.com/kb/930527

Skip past the stuff about using Disk Cleanup. At the bottom it has the steps for command line to get permissions then delete folder with all subfolders and contents.

At least that's what they say.
I imagine it should work as long as your flavor of Windows has takeown.exe installed.
« Last Edit: June 02, 2011, 04:52:12 PM by MilesAhead » Logged

"Genius is not knowing you can't do it that way."
- MilesAhead
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.049s | Server load: 0.48 ]