Create txt file of folder contents

Page 1 of 2 12 LastLast

  1. Posts : 3,302
    Windows 7 Home Premium x64 SP1
       #1

    Create txt file of folder contents


    Hi Guys long time no see, hope you are all well

    I want to create an index of movies on a NAS drive.
    I have a folder G:\Shared Videos on a NAS which has 23 sub folders inside (Film Genres) and a total of 1100 .Mp4 movies spread across these folders. I need a .bat file I can run from inside G:\Shared Videos that will list the 1100 movies, name only (not the Genre Folders or location) in alphabetical order to a text file I can then import to excel to create an Index. Is this possible. I've tried a few I have found searching but there not quite doing what I want.

    Danny
      My Computer


  2. Posts : 140
    Windows Seven Ultimate x64 SP1
       #2
      My Computer


  3. Posts : 3,302
    Windows 7 Home Premium x64 SP1
    Thread Starter
       #3

    Yes tried it Thanks. that copies the whole path I only want the file names

    I have got as far as this but this is only copying the 23 folder names in the public folder to a .txt file which means I would have to run the .bat in all 23 folders and then organise them alphabetically. I need it to omit the folders and list the .Mp4s in the folders only

    Code:
    dir /a /b /-p /o:gen >C:\WINDOWS\Temp\file_list.txt
    start notepad C:\WINDOWS\Temp\file_list.txt
      My Computer


  4. Posts : 5,092
    Windows 7 32 bit
       #4

    Try this ahk script. Instead of using notepad I suggest free EditPad Lite 7. It has sorting and duplicate line elimination.

    To use the script, compile to exe and copy the exe to the root folder. Open command prompt tp root folder and type GetMovieNames.exe. I suggest erasing your text file first as this appends to it.

    Code:
    SendMode Input
    SetWorkingDir %A_ScriptDir%
    
    
    Loop,%A_WorkingDir%,2,1
        Run %comspec% /c  "dir /a /b /-p /o:gen >>C:\WINDOWS\Temp\file_list.txt"
    You can download AutoHotkey_L here
    AutoHotkey Downloads

    There are forums. You can post the script and ask for help embellishing it. For example deleting the results file on start and filtering out the folder names etc..

    Edit: It's worth messing around with ahk since you can make your own hotkey tray utilities to do just about anything when you press a key combination.

    Edit2: ahk and the forums are free. An online email like hotmail or outlook is fine for free registration to the forums.
      My Computer


  5. Posts : 3,302
    Windows 7 Home Premium x64 SP1
    Thread Starter
       #5

    MilesAhead said:
    Try this ahk script. Instead of using notepad I suggest free EditPad Lite 7. It has sorting and duplicate line elimination.

    To use the script, compile to exe and copy the exe to the root folder. Open command prompt tp root folder and type GetMovieNames.exe. I suggest erasing your text file first as this appends to it.

    Code:
    SendMode Input
    SetWorkingDir %A_ScriptDir%
    
    
    Loop,%A_WorkingDir%,2,1
        Run %comspec% /c  "dir /a /b /-p /o:gen >>C:\WINDOWS\Temp\file_list.txt"
    You can download AutoHotkey_L here
    AutoHotkey Downloads

    There are forums. You can post the script and ask for help embellishing it. For example deleting the results file on start and filtering out the folder names etc..

    Edit: It's worth messing around with ahk since you can make your own hotkey tray utilities to do just about anything when you press a key combination.

    Edit2: ahk and the forums are free. An online email like hotmail or outlook is fine for free registration to the forums.
    Thanks Miles will give it a go, one question why the >> oppose to my single
      My Computer


  6. Posts : 4,776
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #6

    Movie file names to .csv?


    Hi,

    I must confess that I cannot write a script for you but I have another solution that works for me.

    I have installed Saleen Video Manager as a portable app and it stores videos that are added to the library in an Access Database (.mdb format).

    Create txt file of folder contents-videomanag-4.jpg

    It's possible to open this database using any software that can open and view .mdb files.

    It's then possible to choose columns and sort by path or alphabetically and export to .csv.

    You'd only need to sort by path if you added more than one directory to the library.

    Create txt file of folder contents-videomanag-3.jpg

    Here's a screenshot of part of an exported list of files in .mdb and .csv formats/ views.

    Create txt file of folder contents-videomanag.jpg
    Attached Thumbnails Attached Thumbnails Create txt file of folder contents-videomanag-2.jpg  
    Last edited by Callender; 02 Mar 2014 at 12:38. Reason: Move images
      My Computer


  7. Posts : 3,302
    Windows 7 Home Premium x64 SP1
    Thread Starter
       #7

    Got it in the end was missing the s switch. Anyone needs it copy to notepad and save as .bat and run from the directory you want the list of files for

    Code:
    dir /a:-d /b /s /o:n >C:\WINDOWS\Temp\file_list.txt
    start notepad C:\WINDOWS\Temp\file_list.txt
    Cheers Guys

    Danny
      My Computer


  8. Posts : 5,092
    Windows 7 32 bit
       #8

    The >> is append to file. The > will overwrite the file.

    Also if they are all the same file type such as .mp4 use dir *.mp4 /s instead of just dir /s
      My Computer


  9. Posts : 3,302
    Windows 7 Home Premium x64 SP1
    Thread Starter
       #9

    Thanks Miles any way to get the list without the file path just the Mp4 name
      My Computer


  10. Posts : 5,092
    Windows 7 32 bit
       #10

    See if this works

    Code:
    SendMode Input
    SetWorkingDir %A_ScriptDir%
    ResultFile := "C:\WINDOWS\Temp\file_list.txt"
    
    Loop,*.mp4,,1
        FileAppend,%A_LoopFlename%`n,%ResultFile%
    Edit: I added the "`n" to the "%A_LoopFlename%" in the script so it should write one name per line to the text file.

    Edit2: I haven't tested it. Should be simple enough but you never know. If it doesn't work as expected post and I'll try to fix it up. :)
    Last edited by MilesAhead; 02 Mar 2014 at 17:16.
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:37.
Find Us