Command Line Prompt - How To Export List of Files to Text File


  1. Posts : 46
    Windows 7 Home Premium SP1 64bit
       #1

    Command Line Prompt - How To Export List of Files to Text File


    Hi guys,

    I have a folder with 995 files in it and I'd like to give someone a text file with a list of all these files in it. Is there a way that I can get the command line to send the names of these files to a text file?

    I tried navigating to the directory and using the DIR command and, sure enough it gives me a list but I am unable to copy and paste it to a textfile myself for some reason.

    Any help would be appreciated.
      My Computer


  2. Posts : 797
    Windows 7 Ultimate (x64)
       #2

    type this:

    DIR > dir.txt

    This should save the output of DIR into the text file dir.txt
      My Computer


  3. Posts : 46
    Windows 7 Home Premium SP1 64bit
    Thread Starter
       #3

    unifex said:
    type this:

    DIR > dir.txt

    This should save the output of DIR into the text file dir.txt
    Thanks for the help. Got it working now!!
      My Computer


  4. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #4

    Try Dir "C:\Users\user\Unsorted\Guitar Tab\PDF files" > "C:\Users\user\Desktop\dir.txt"
      My Computer


  5. Posts : 46
    Windows 7 Home Premium SP1 64bit
    Thread Starter
       #5

    Dwarf said:
    Try Dir "C:\Users\user\Unsorted\Guitar Tab\PDF files" > "C:\Users\user\Desktop\dir.txt"
    All sorted now, thank you :)
      My Computer


  6. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #6

    You're welcome. :)
      My Computer


 

  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 12:29.
Find Us