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

Results 1 to 8 of 8
  1.     
    #1
    Member

    Default List files in all subfolders

    I have a directory with a bunch of subfolders (contains special/chinese characters) I want to create a txt file in each subfolder that will list all the files in that subfolder. I am running Windows Server 2003. How can I do this with CMD? or any other tools
    Ruriko Reviewed by Ruriko on . List files in all subfolders I have a directory with a bunch of subfolders (contains special/chinese characters) I want to create a txt file in each subfolder that will list all the files in that subfolder. I am running Windows Server 2003. How can I do this with CMD? or any other tools Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    This lists all the files (and only the files) in the current directory:

    for /r %i in (*) do echo %i
    Also if you run that command in a batch file you need to double the % signs.

    for /r %%i in (*) do echo %%i

  4.     
    #3
    Member
    it lists the file but it doesn't create the txt file

  5.     
    #4
    Respected Member
    Just use the other one I made and add the dir like this
    Code: 
    @setlocal EnableDelayedExpansion
    @echo off
    chcp 65001 > nul
    for /F "delims=" %%a in ('dir /ad /b /s') do ( @echo %%~nxa > %%a\test.nfo
    dir /b %%a\*.* >> %%a\test.nfo  )

  6.     
    #5
    Member
    Doesn't seem to work all it does is gives me the folder name instead of listing all the files in that subfolder

  7.     
    #6
    Respected Member
    If you have sub folders in folders it will show those along with the file names. It is working fine for me..

    Let me add the chinese folders back and see how it works..

    Ok try this one
    Code: 
    @echo off
    chcp 65001 > nul
    for /F "delims=" %%a in ('dir /ad /b /s') do (
    pushd somedir
    cd %%a
    for /f "delims=" %%f in ('dir /b /a-d-h-s') do ( @echo %%~nxa > test.nfo 
    @echo %%f >> test.nfo)
    popd
    )

  8.     
    #7
    Member
    ok that one works now

  9.     
    #8
    Respected Member
    You are welcome. Also need to check your posts a little more ..

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. List of FIlehost which allows free download of big files
    By babarali124 in forum File Host Discussion
    Replies: 8
    Last Post: 10th Aug 2012, 11:53 PM
  2. Does Hotfiles Copy Option Backup Files? (DMCA Removed Files)
    By elpirata in forum File Host Discussion
    Replies: 4
    Last Post: 20th Jan 2011, 05:26 PM
  3. Replies: 10
    Last Post: 13th Jul 2010, 04:49 PM
  4. [Source Files] Anti-Freeze & Lockout Files [Paypal]
    By ka0s_ in forum Completed Transactions
    Replies: 1
    Last Post: 25th Oct 2009, 01:10 PM
  5. Replies: 23
    Last Post: 3rd Jul 2009, 04:07 AM

Tags for this Thread

BE SOCIAL