Announcement

Collapse
No announcement yet.

export dir to file

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • export dir to file

    hello,
    i would like export a listing of "my documents" folder
    to a text file, but so far have been unsuccesful.

    doing so in batch/cmd script is preferable, but VBScript
    is also fine.

    i would be thankful for any input.

    thank you.

  • #2
    Re: export dir to file

    from a cmd prompt type:

    dir > c:\file_name.txt
    This will export the contents of the folder to a text file in the root of c:\ called file_name.txt

    if you have folders in there and you want to drill down then use the /s argument.

    Hope this is what your after

    Michael
    Michael Armstrong
    www.m80arm.co.uk
    MCITP: EA, MCTS, MCSE 2003, MCSA 2003: Messaging, CCA, VCP 3.5, 4, 5, VCAP5-DCD, VCAP5-DCA, ITIL, MCP, PGP Certified Technician

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

    Comment


    • #3
      Re: export dir to file

      And you may want to try the /B switch if you're looking for fully qualified file names and don't care about all the other stuff you normally get.

      Try dir /b /s > c:\file_name.txt
      Cheers,

      Rick

      ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

      2006-2099 R Valstar. This post is offered "as is" for discussion purposes only with no express or implied warranty of any kind including, but not limited to, correctness or fitness for use. Nothing herein shall be construed as advice. Attempting any activity based on information in this post is done at your own risk.

      Comment

      Working...
      X