find folders without mp3 file
Moderators: fgagnon, nikos, Site Mods
find folders without mp3 file
I have a folder " 1mm" with many subfolders,these contain jpg and mp3 files ; i am trying to figure out how i can search these subfolders with as result the folders which have jpg files but not mp3 files .
thanks,lin
thanks,lin
Users' Challenge - III
That's the only thing I could think of, too.
But it's messy in that there will be as many entries for each folder as there are for .jpg files.
And I don't know how to efficiently remove folders that have both jpg's and mp3's without manually trolling through the list.
If it is even possible to do in straightforward manner, it is a candidate for a Users' Challenge, ref: this thread & post. :twisted:
But it's messy in that there will be as many entries for each folder as there are for .jpg files.
And I don't know how to efficiently remove folders that have both jpg's and mp3's without manually trolling through the list.
If it is even possible to do in straightforward manner, it is a candidate for a Users' Challenge, ref: this thread & post. :twisted:
-
- Silver Member
- Posts: 281
- Joined: 2006 Dec 29, 12:56
- Location: Utrecht, NL
I would try it this way:
1. Go in the left hand pane to the folder 1mm.
2. In the right hand pane, open a random empty folder somewhere outside 1mm.
3. Go to the left hand pane, select all, and open a Robust Copy dialog (F5).
4. Define a Filter, with '*.mp3' in the 'Named' field. For the rest use normal copy settings. This will copy only mp3 files, and the folders in which they are placed.
5. Open the synchronization wizard (ctrl+F9), and compare 'Unique' items on 'Name only', with 'Consider folders, too' checked.
The folders which get selected won't contain any mp3 files in the folder itself or in any of its subfolders.
I don't know if this works for you, because this also means that the UNselected folders might contain one or more subfolders without mp3 files. You just have selected folders on the root level of 1mm.
I think it is possible to get a selection of all deeper subfolders without mp3 files, but I can only think of much more complicated methods.
1. Go in the left hand pane to the folder 1mm.
2. In the right hand pane, open a random empty folder somewhere outside 1mm.
3. Go to the left hand pane, select all, and open a Robust Copy dialog (F5).
4. Define a Filter, with '*.mp3' in the 'Named' field. For the rest use normal copy settings. This will copy only mp3 files, and the folders in which they are placed.
5. Open the synchronization wizard (ctrl+F9), and compare 'Unique' items on 'Name only', with 'Consider folders, too' checked.
The folders which get selected won't contain any mp3 files in the folder itself or in any of its subfolders.
I don't know if this works for you, because this also means that the UNselected folders might contain one or more subfolders without mp3 files. You just have selected folders on the root level of 1mm.
I think it is possible to get a selection of all deeper subfolders without mp3 files, but I can only think of much more complicated methods.
Re: Users' Challenge - III
I only want to remove the folders with no mp3's in it.fgagnon wrote:That's the only thing I could think of, too.
But it's messy in that there will be as many entries for each folder as there are for .jpg files.
And I don't know how to efficiently remove folders that have both jpg's and mp3's without manually trolling through the list.
All the folders have jpg in it.
If the subfolders are at first level this script will handle the folders
EDITED: away went my testcase...
save as a .cmd file and run it from a cmd-prompt (two lines).
NOTE this will delete all files and remove the folder - try it on a test subset first!
Code: Select all
@echo off
for /D %%d in (*.*) do if not exist %%d\*.mp3 del %%d\*.* & rmdir %%d
save as a .cmd file and run it from a cmd-prompt (two lines).
NOTE this will delete all files and remove the folder - try it on a test subset first!
Thanks ,could you elaborate please , i'm not good on scripts ;the subfolders are located below : H:\1mm\ where would i put this path?tonne wrote:If the subfolders are at first level this script will handle the folders
EDITED: away went my testcase...Code: Select all
@echo off for /D %%d in (*.*) do if not exist %%d\*.mp3 del %%d\*.* & rmdir %%d
save as a .cmd file and run it from a cmd-prompt (two lines).
NOTE this will delete all files and remove the folder - try it on a test subset first!
Start a cmd-prompt (start/run/cmd.exe), change active drive h: change active directory cd \1mm (save the script in this folder) and start the script.
Remember to make a test-case or start with this only listing the folders without mp3 files.
Remember to make a test-case or start with this only listing the folders without mp3 files.
Code: Select all
@echo off
for /D %%d in (*.*) do if not exist %%d\*.mp3 echo %%d
only the listing works ok, but i get : " The syntax of the command is incorrect." using the delete code.tonne wrote:Start a cmd-prompt (start/run/cmd.exe), change active drive h: change active directory cd \1mm (save the script in this folder) and start the script.
Remember to make a test-case or start with this only listing the folders without mp3 files.Code: Select all
@echo off for /D %%d in (*.*) do if not exist %%d\*.mp3 echo %%d
Lin
EDIT i put the code on 2 lines like you said ,i now get : "The system cannot find the file specified."
For a slightly less nuts and bolts approach, try this handy little freeware programme designed specifically for finding/removing empty folders. A simple option can be set to not consider *.JPG's, thus considering the folder empty if no other file types exist. Very handy for managing those pesky multi-foldered music collections. (Obviously nothing is deleted without confirmation, so it's safe to experiment with.)
RED (Remove Empty Directrories
Happily works in XP or Vista, any flavour.
RED (Remove Empty Directrories
Happily works in XP or Vista, any flavour.
Thank you for thr tip, but this issue is incidential ,no use installing an app just to use it once.Kilmatead wrote:For a slightly less nuts and bolts approach, try this handy little freeware programme designed specifically for finding/removing empty folders. A simple option can be set to not consider *.JPG's, thus considering the folder empty if no other file types exist. Very handy for managing those pesky multi-foldered music collections. (Obviously nothing is deleted without confirmation, so it's safe to experiment with.)
RED (Remove Empty Directrories
Happily works in XP or Vista, any flavour.
Cheers,lin
It's a pity bloated malware like Adobe-(anything) and the like have instilled an honest dislike of any superfluous installation procedures. Fair enough, I try to run a clean ship too. Unwarranted in this case. It's harmless, unintrusive, and surprisingly handy in the unknown future. And far less likely to lead to accidental "Oops" moments as ad hoc scripting has been known to do.lin wrote:...no use installing an app just to use it once.
To each their own.
The two lines are:
Line1:
Line2:
Which windows version - it works fine on vista.
Line1:
Code: Select all
@echo off
Code: Select all
for /D %%d in (*.*) do if not exist %%d\*.mp3 echo %%d