Directory List

Page 2 of 3 FirstFirst 123 LastLast

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

    You only need quote-marks around the filename(s) (including the path(s)) if either or both contain spaces. It makes no difference whether you include them or not, but you MUST include them if there is a space anywhere in the relevant filename or path.

    Examples (note that Src is the source drive and Dst is the destination drive).
    Code:
    DIR "Src:\data" /s > "Dst:\List.txt"
    This format will ALWAYS work.
    Code:
    "Src:\data" /s > "Dst:\List.txt
    This will NOT work (missing " - these need to be in pairs).
    Code:
    "Src:\data /s > Dst:\List.txt"
    This will NOT work (" to be placed around filename(s) (including the path(s)) only).
    Code:
    "Src:\data" /s > Dst:\Data List.txt
    This will NOT work (destination filename contains a space).
    Code:
    "Src:\data" /s > Dst:\Data List\List.txt
    This will NOT work (destination path contains a space).
      My Computer


  2. Posts : 1,112
    XP_Pro, W7_7201, W7RC.vhd, SciLinux5.3, Fedora12, Fedora9_2x, OpenSolaris_09-06
       #12

    Dwarf said:
    You only need quote-marks around the filename(s) (including the path(s)) if either or both contain spaces. It makes no difference whether you include them or not, but you MUST include them if there is a space anywhere in the relevant filename or path.
    Thank you for the definitive examples.
    Member 'huffman' should be well versed on this now...

    As a side note:
    I believe the "pipe" symbol is |
    i.e. type list.txt | more
    (in olden days)

    whereas the > symbol indicates 'redirection'
    i.e. not to console, but to a file.
    (in olden days)

    But, they may have changed the terminology for Vista/w7...
      My Computer


  3. Posts : 4,573
       #13

    ChuckR said:

    The /h option is good too, if he wants to see hidden files...
    /a:h to be exact
      My Computer


  4. Posts : 4,573
       #14

    ChuckR said:
    I believe the "pipe" symbol is |
    i.e. type list.txt | more
    (in olden days)

    whereas the > symbol indicates 'redirection'
    i.e. not to console, but to a file.
    (in olden days)
    Right-o
      My Computer


  5. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #15

    ChuckR said:
    As a side note:
    I believe the "pipe" symbol is |
    i.e. type list.txt | more
    (in olden days)

    whereas the > symbol indicates 'redirection'
    i.e. not to console, but to a file.
    (in olden days)

    But, they may have changed the terminology for Vista/w7...
    Me too, I was using the wrong term. Sorry. In my earlier post I ment redirection when talking about pipe.

    I stand corrected.

    Kari
      My Computer


  6. Posts : 1,112
    XP_Pro, W7_7201, W7RC.vhd, SciLinux5.3, Fedora12, Fedora9_2x, OpenSolaris_09-06
       #16

    As another side note,

    I prefer the list to show 'folders' first, then the 'filenames'.

    Both sorted alphabetically, therefore I use options

    /O:GN

    To save typing it all the time, I use the "Set Environment Variable" command:

    set dircmd=DIR /O:GN /P (where the /P option is 'page at a time', onscreen)

    Then, when I type 'dir',
    the output to the crt is folders first, followed by filenames, both sorted alpha, and a screenful at a time...
    Looking like this:

    (I don't really use the /system or /hidden options, since I always enable the
    "Don't Hide nuthin", "Show System-files", "Show FileExtensions", etc. via Windows, so I can always see what's really there.)

    Hope this helps...
    Attached Thumbnails Attached Thumbnails Directory List-dir0.png  
      My Computer


  7. Posts : 713
    Windows 7 Pro
    Thread Starter
       #17

    Thank you guys very much finally have two prompts that work:

    DIR "E:\data\" /s > "C:\List.txt"

    and

    DIR E:\data\ /s > C:\List.txt
      My Computer


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

    I'm pleased that you have solved your problem.

    As for the prompts, I recommend the former one, with the quotes ("), as you can't go wrong with that.
      My Computer


  9. Posts : 5,642
    Windows 10 Pro (x64)
       #19

    [samp]tree X:\ /f/a > tree.txt[/samp]
    Produces a much better looking display.
      My Computer


  10. Posts : 1
    Seven, Of Course!
       #20
      My Computer


 
Page 2 of 3 FirstFirst 123 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:21.
Find Us