New
#1
List sub folder names
Hi, I have a huge folder G:\Manga, in it are the subfolders, and I want to list only names of all subfolders within this folder G:\Manga to txt file
how can I do this?
Thanks!
Hi, I have a huge folder G:\Manga, in it are the subfolders, and I want to list only names of all subfolders within this folder G:\Manga to txt file
how can I do this?
Thanks!
Thanks for that Paul; tried to rep you but no can do until I spread more around.
Played with that and found that this works to grab the subfolders too:
dir /s /a /b /o:n > d:\downloads\folderlist.txt
Is there a way to add a folder count to that command? I'm gonna try and find that. I've got tens of thousands of folders.
Hmmm.......
It seems that grabs folders and individual files as well.............if the individual files are in the root.
I can't see a way to get a folder count or to exclude files in the root.
Yes. But I didn't see anything related to folder count or excluding files in the root.........that is to say "give me a list of folders ONLY, ignore files". And give me a folder count.
Fiddling with the switches right now, without success. I still get files and without a folder count.
I can get a folder count if I do a simple dir /s *.*
Hello @Takeshi18 [ @ignatzatsonic ] ,
I have just written this script that will do what you want . . .
Copy the script into Notepad and save it as a .bat file. Put the .bat file in the directory [ Parent directory ] where you want the information. It will output a text file on the desktop named Folders_Sub-Folders.txt.Code:@echo off set "Out=%UserProfile%\Desktop\Folders_Sub-Folders.txt" if exist "%OUT%" (del /f /q "%OUT%" >nul 2>&1) set /a count=0 for /f "tokens=*" %%A in ('dir /s /b /a:d /o:n ^| findstr /v /i "%Out%"') do ( set /a count+=1 >> "%Out%" echo %%A ) >> "%Out%" echo ============================================================================== >> "%Out%" echo Folders: %count% >> "%Out%" echo ============================================================================== echo. & echo ^>Press ANY key to EXIT . . . & pause > nul & cls & goto :Exit :Exit
I hope this helps.