output end-level empty subfolders
Moderator: DosItHelp
-
- Posts: 24
- Joined: 07 Dec 2012 04:33
output end-level empty subfolders
how can i list my empty folders and subfolders in a main folder?
supose that my main folder is:
f:\ta\a\main\sub1\
f:\ta\a\main\sub2\subsub1
f:\ta\a\main\sub3\subsub2
f:\ta\a\main\sub4\subsub3\subsubsub1
f:\ta\a\main\sub5\subsub4\subsubsub1
supose that folder 'main' is completely empty.
i want a program that output a list of end-level empty subfolders, i mean in this example,
output these .txt file:
f:\ta\a\main\sub1\
f:\ta\a\main\sub2\subsub1
f:\ta\a\main\sub3\subsub2
f:\ta\a\main\sub4\subsub3\subsubsub1
f:\ta\a\main\sub5\subsub4\subsubsub1
and don't output these line:
f:\ta\a\main
f:\ta\a\main\sub2
f:\ta\a\main\sub3
f:\ta\a\main\sub4
f:\ta\a\main\sub4\subsub3
f:\ta\a\main\sub5
f:\ta\a\main\sub5\subsub4
supose that my main folder is:
f:\ta\a\main\sub1\
f:\ta\a\main\sub2\subsub1
f:\ta\a\main\sub3\subsub2
f:\ta\a\main\sub4\subsub3\subsubsub1
f:\ta\a\main\sub5\subsub4\subsubsub1
supose that folder 'main' is completely empty.
i want a program that output a list of end-level empty subfolders, i mean in this example,
output these .txt file:
f:\ta\a\main\sub1\
f:\ta\a\main\sub2\subsub1
f:\ta\a\main\sub3\subsub2
f:\ta\a\main\sub4\subsub3\subsubsub1
f:\ta\a\main\sub5\subsub4\subsubsub1
and don't output these line:
f:\ta\a\main
f:\ta\a\main\sub2
f:\ta\a\main\sub3
f:\ta\a\main\sub4
f:\ta\a\main\sub4\subsub3
f:\ta\a\main\sub5
f:\ta\a\main\sub5\subsub4
-
- Posts: 24
- Joined: 07 Dec 2012 04:33
Re: output end-level empty subfolders
this program can job that, but don't work for unicode character:
http://simonwai.com/bin/EmptyFolderNuker.exe
http://simonwai.com/bin/EmptyFolderNuker.exe
Re: output end-level empty subfolders
The problem is in the cmd window, it can't display unicode character, try to out-put the result to a txt file and open the file after it is done, maybe that might work.
Edited:
This work for me
Put it in the main folder
Edited:
This work for me
Code: Select all
@ECHO OFF
Del /F /Q "log.log" 2>nul
For /F "delims=" %%A in ('DIR /B /S "*.*"') Do echo %%A>>log.log
log.log
Put it in the main folder
-
- Posts: 24
- Joined: 07 Dec 2012 04:33
Re: output end-level empty subfolders
@abc0502,
thanks, but my output isn't that i'm goal. I upload log file:
http://letitbit.net/download/38559.3ecbb4bfb7a29b5aa42071b98829/log.log.html
thanks, but my output isn't that i'm goal. I upload log file:
http://letitbit.net/download/38559.3ecbb4bfb7a29b5aa42071b98829/log.log.html
Re: output end-level empty subfolders
sorry, this website is annoying, upload to any other website. and explain what exactly you mean.
-
- Posts: 24
- Joined: 07 Dec 2012 04:33
Re: output end-level empty subfolders
log file:
http://depositfiles.com/files/lo3etp4yc
i want output only empty folders that even have not any folder in it.
supose I have:
main
|_subfol
|_subsubfol
and main is empty folder, itmeans that subfol and subsubfol are also empty, but main contain a foder and subfol contain a folder too,
I have just the path empty folders that contain anything.
In this example i want output :
main\subfol\subsubfol
http://depositfiles.com/files/lo3etp4yc
i want output only empty folders that even have not any folder in it.
supose I have:
main
|_subfol
|_subsubfol
and main is empty folder, itmeans that subfol and subsubfol are also empty, but main contain a foder and subfol contain a folder too,
I have just the path empty folders that contain anything.
In this example i want output :
main\subfol\subsubfol
Re: output end-level empty subfolders
Sorry, do you mean you just want to display the last folder in the tree of all folders.
and empty means that the folder must not contain any other sub-folders ?
and empty means that the folder must not contain any other sub-folders ?
-
- Posts: 24
- Joined: 07 Dec 2012 04:33
Re: output end-level empty subfolders
Sorry, do you mean you just want to display the last folder in the tree of all folders.
and empty means that the folder must not contain any other sub-folders ?
Exactly.
Re: output end-level empty subfolders
Do you want to display them or do you want to delete them?
-
- Posts: 24
- Joined: 07 Dec 2012 04:33
Re: output end-level empty subfolders
@foxidrive
Do you want to display them or do you want to delete them?
I want display them too a .txt file.
Re: output end-level empty subfolders
See if this works for you:
Code: Select all
@echo off
for /d /r %%a in (*) do (
dir /b /a "%%a" 2>nul | find /c /v "" | findstr "^0$" >nul && >> file.txt echo %%a
)
pause
Re: output end-level empty subfolders
nice one Foxidrive, mine reached 10 lines and didn't complete yet 

-
- Posts: 24
- Joined: 07 Dec 2012 04:33
Re: output end-level empty subfolders
See if this works for you:
Code:
@echo off
for /d /r %%a in (*) do (
dir /b /a "%%a" 2>nul | find /c /v "" | findstr "^0$" >nul && >> file.txt echo %%a
)
pause
it's work, but not for unicode, if i run that for unicode, output ? character instead of any unicode character like this:
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\358.30 ?????? ??? (1)
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\358.54 ??? ??? ????? ???????
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\359.38 ?????? ?????? ????? (???????)
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\359.39 ??????? ??????? ???????
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\359.40 ?????? ??????? ???????
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\359.54 ????? 2
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\450.7 ???? ??? ???? ???? ????? 3
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\461.3 ???? ??? ??????? ??????
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\482.8 ????? 3(???????)
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\490.6 ?????? ??? ???????
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\492.9 ??? ???????
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\494.6 ??????? ??????
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\494.9 ?????? ??????? ??????
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\495.8 ??????? ??????
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\496 ?????? ??????? ??????
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\496.6 ?????? ??? (2)
D:\a\07 ?????? - ??? ???? ??-????\04 ???????\??? ???\497 ???? ??? ???????
Re: output end-level empty subfolders
it work for me here, does the notepad is supporting the language that your folders is named with?
Follow these steps:
That might be the reason why the notepad doesn't display the characters in correct format.
Follow these steps:
1> Control panel
2> Regional and language options
3> select 3rd tab "advanced"
4> choose your language in "language for non-unicode programs" section and then reboot.
also, make sure that in the 2nd tab "languages" in supplemental language support section, the 1st choice is choosed "install files for complex script and right-to-left language..." if your language is wrote from right-to left
That might be the reason why the notepad doesn't display the characters in correct format.