Need help with Command Prompt.

Discussion in 'Windows Desktop Systems' started by pluto, Mar 20, 2006.

  1. pluto

    pluto OSNN Addict

    Im trying to create a txt file with the list of folders in a directory in the format:


    I have managed this before but I have forgotten the commands and on the Microsoft site, I cant find the commands to remove the date and format it how I want on their either anymore.

    Can anyone help?

    I got as far as:

    dir >a.txt /b

    but that just shows [level1]. Need it to show level2 as well.

    EDIT - I need to filter out all folders but ones with 2006 in the name.

    [level1]/2006 [level2]
    Last edited: Mar 20, 2006
  2. madmatt

    madmatt Bow Down to the King Political User

    New York
    To make a list of files within a directory
    run command
    cd <dir>
    dir > file.txt
  3. the_tazinator

    the_tazinator Are we there yet?

    In a house
    Open a DOS prompt and type "tree" and see if that gives you want you are looking for.
  4. pluto

    pluto OSNN Addict

    Ahhhhhh,just worked that one out.

    Oooooh, that might come in handy but was not what I was looking for.

    Thanks anyway.

    How do I filter out folders? Say, folders are named 2000, 2001, 2002, 2003, 2004, how can I filter to only show folders with the date of 2002?
  5. pluto

    pluto OSNN Addict

    Ok! Worked it out, solution as follows:

    dir /a:d /s/b | find "2006" >a.txt