Wednesday, 10 April 2013

How to Create a File List using Simple Batch File (.bat) in Windows

Sometimes we need to create a list of files contained in a folder or drive, but there is no menu in Windows (XP/Vista/7/8) to do this. If you search about how to do this on the internet, you will find many article and tutorial about it, but they did it through command prompt. It was quite a hassle because you have to repeatedly typing the command manually. This time we will create a simple batch (.bat) application that can generate a text file contains list of files and sub-folders from the folder where this little application is located, and if you want create a list of files in another folder, just move this app into that folder.
  1. Open Notepad and then type this:
    dir /b > fileslist.txt
    if you want a recursive listing, type this:
    dir /b /s > fileslist.txt
    Open notepad

  2. Click File > Save As…
    Save as
  3. Save as type: All Files, File name: filelist.bat
    save as bat file
  4. Now just double click on filelist.bat and it will generate filelist.txt which contains list of files and folders. If you want create a list of files in another folder, just move this app into that folder.
    filelist.bat

No comments:

Post a Comment