Activity Stream
48,167 MEMBERS
6776 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 10 of 10
  1.     
    #1
    Member

    Default Auto create txt file in each folder

    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?
    Ruriko Reviewed by Ruriko on . Auto create txt file in each folder 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? Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Respected Member
    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..

  4.     
    #3
    Member
    Is there a way to make it work with folders containing Chinese characters?

  5.     
    #4
    Respected Member
    If the folder was written successfully in chinese characters than it should use them. What results are you getting now??

  6.     
    #5
    Member
    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

  7.     
    #6
    Respected Member
    Use a dir /b/s > dir.lst command line command and paste the links here in a code box.

  8.     
    #7
    Member
    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]

  9.     
    #8
    Respected Member
    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 )

  10.     
    #9
    Member
    thanks it works

  11.     
    #10
    Respected Member
    You are welcome.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Delete specific file in each folder
    By Ruriko in forum Technical Help Desk Support
    Replies: 6
    Last Post: 6th Oct 2012, 01:05 AM
  2. Create Bootable USB from Folder and ISO Images
    By Daniel in forum Tutorials and Guides
    Replies: 12
    Last Post: 4th Nov 2011, 11:36 PM
  3. How to copy all file names of a folder
    By cotufa-ssdd in forum Tutorials and Guides
    Replies: 10
    Last Post: 8th Sep 2011, 01:03 AM
  4. Proper file/folder ownership
    By Hillside in forum Technical Help Desk Support
    Replies: 2
    Last Post: 12th Apr 2011, 03:42 PM
  5. need SSH command to change file/folder's Owner
    By onel0ve in forum Webmaster Discussion
    Replies: 7
    Last Post: 17th Jan 2011, 06:19 PM

Tags for this Thread

BE SOCIAL