Status
Not open for further replies.

Ruriko

Active Member
692
2008
10
315
I have a directory with thousands of subfolders in them. I want to create a text file in each folder containing the folder name in it. How can I do this in windows?
 
9 comments
Here you go create a file called getDirs.bat and add this content
Code:
@ECHO OFF
for /F "delims=" %%a in ('dir /ad /b /s') do (
   @echo %%~nxa > %%a\test.nfo
)

Put it in the folder with all the subfolders and run it. You can make test.nfo to anything you want..
 
Well the error closes so fast that I couldn't fully read it but it said something about directory being syntax error. Works fine with english characters
 
Code:
C:\Documents and Settings\Administrator\Desktop\ArtistCG\(C82) [HYPER BRAND] Operation RAGNAROK CAN BE REAL (Ragnarok Online) [517251]
C:\Documents and Settings\Administrator\Desktop\ArtistCG\(C82) [HYPER BRAND] Operation RAGNAROK EXTRA PACK 15 (Ragnarok Online) [517257]
C:\Documents and Settings\Administrator\Desktop\ArtistCG\Clarisse Karen vol.2 vol.3 (Lupin III Castle of Cagliostro) [514663]
C:\Documents and Settings\Administrator\Desktop\ArtistCG\dir.lst
C:\Documents and Settings\Administrator\Desktop\ArtistCG\getDirs.bat
C:\Documents and Settings\Administrator\Desktop\ArtistCG\Kokyu No Heya - Inzuma Wakai Juusei Ni Yogaru Hitozuma Complete [English] [515227]
C:\Documents and Settings\Administrator\Desktop\ArtistCG\Nakuru-chan is my sexy waifu~ [523721]
C:\Documents and Settings\Administrator\Desktop\ArtistCG\Yabougumi Daiyaboureki [513600]
C:\Documents and Settings\Administrator\Desktop\ArtistCG\[ Go! Go! Heaven!!]?????????????25 -?????? ???- [525067]
C:\Documents and Settings\Administrator\Desktop\ArtistCG\[12CUT] ????? (Gakkou no Kaidan) [518382]
C:\Documents and Settings\Administrator\Desktop\ArtistCG\[2????] ?????!??CD?????????? [521206]
C:\Documents and Settings\Administrator\Desktop\ArtistCG\[Ability] ????????????????????? [514182]
C:\Documents and Settings\Administrator\Desktop\ArtistCG\[Abo Manten] Kyuusho seme maniacs vol. 3 (Weak Spot Maniacs vol.3) [521993]
C:\Documents and Settings\Administrator\Desktop\ArtistCG\[Afro] Futanari angel cg collection [521560]
C:\Documents and Settings\Administrator\Desktop\ArtistCG\[Aim-ZERO] Case Vol.4 [519927]
C:\Documents and Settings\Administrator\Desktop\ArtistCG\[Air Hike] ?	??????CG?2 [525114]
C:\Documents and Settings\Administrator\Desktop\ArtistCG\[Air Hike] ?	??????CG?3 [525117]
 
I guess that didn't work. Upload the file to a file host and pm me the link.

**************Update*****************************

change bat file to this
Code:
@ECHO OFF
chcp 65001 > nul
for /F "delims=" %%a in ('dir /ad /b /s') do ( @echo %%~nxa > %%a\test.nfo )
 
Last edited:
Status
Not open for further replies.
Back
Top