+ Post New Thread
Results 1 to 7 of 7
Scripts Thread, Script to get all files and folders in a directory and save to txt file in Coding and Web Development; Hi all, I am in need of a script to produce a txt file congaing everything in a folder and ...
  1. #1

    Join Date
    Nov 2009
    Location
    somewhere
    Posts
    23
    Thank Post
    28
    Thanked 4 Times in 3 Posts
    Rep Power
    0

    Script to get all files and folders in a directory and save to txt file

    Hi all,

    I am in need of a script to produce a txt file congaing everything in a folder and all of its sub directories including all the files and folders in there e.g

    C:\
    -C:\Users\
    --C:\Users\TestUser\
    --C:\Users\Fake Account\
    ---C:\Users\TestUser\file1.txt
    ---C:\Users\TestUser\idontknow.bat
    -C:\Windows\
    -C:\Program Files\

    etc etc if u get the idea, Does anyone know of a script that could do that ?

  2. IDG Tech News
  3. #2
    stevehill06's Avatar
    Join Date
    Nov 2007
    Location
    Hastings
    Posts
    702
    Thank Post
    117
    Thanked 156 Times in 121 Posts
    Rep Power
    62
    you could use the DIR command in CMD. Can't remember what switch is needed on the end but if you do DIR /? in CMD it will give you a list of switches you can use.

  4. Thanks to stevehill06 from:

    timethrow (30th November 2011)

  5. #3

    Join Date
    Nov 2009
    Location
    somewhere
    Posts
    23
    Thank Post
    28
    Thanked 4 Times in 3 Posts
    Rep Power
    0
    Hi Steve,

    Thanks for the reply, However that only lists the stuff in the specific folder not in sub-directories etc. Which is what I would like to do. Thanks Anyway

  6. #4
    bmdixon's Avatar
    Join Date
    Apr 2008
    Location
    Birmingham
    Posts
    236
    Thank Post
    30
    Thanked 50 Times in 31 Posts
    Rep Power
    19
    dir /b /d /s
    should be something like that...

  7. Thanks to bmdixon from:

    timethrow (30th November 2011)

  8. #5

    Join Date
    Jun 2006
    Location
    Kendal
    Posts
    81
    Thank Post
    2
    Thanked 11 Times in 8 Posts
    Rep Power
    16
    dir /a /s >file.txt

    it isn.t pretty but it works

  9. Thanks to Finch7 from:

    timethrow (30th November 2011)

  10. #6
    box_l's Avatar
    Join Date
    May 2007
    Location
    Herefordshire
    Posts
    357
    Thank Post
    56
    Thanked 72 Times in 59 Posts
    Rep Power
    25
    Code:
    dir /s /a-d /b /on-s >> ./File_Listing.txt

    BoX

  11. Thanks to box_l from:

    timethrow (30th November 2011)

  12. #7

    Join Date
    Nov 2009
    Location
    somewhere
    Posts
    23
    Thank Post
    28
    Thanked 4 Times in 3 Posts
    Rep Power
    0
    Apologies to Steve and thanks to you all, That has worked beautifully

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 2
    Last Post: 2nd September 2011, 12:10 PM
  2. Replies: 2
    Last Post: 17th April 2008, 11:25 AM
  3. Replies: 3
    Last Post: 18th January 2008, 01:46 PM
  4. Script to get all file on a url
    By Midget in forum Scripts
    Replies: 5
    Last Post: 23rd January 2007, 01:10 PM
  5. Replies: 3
    Last Post: 25th September 2006, 12:27 PM

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •