Windows 10: DOS Dir Command issues-dir *. /s doesn't get all subfolders?

Discus and support DOS Dir Command issues-dir *. /s doesn't get all subfolders? in Windows 10 Software and Apps to solve the problem; I am trying to get an accurate picture of my music library, where all music is stored in album subfolders under artist folders. I opened a CMD window... Discussion in 'Windows 10 Software and Apps' started by RichardReithner, Jun 14, 2020.

  1. DOS Dir Command issues-dir *. /s doesn't get all subfolders?


    I am trying to get an accurate picture of my music library, where all music is stored in album subfolders under artist folders. I opened a CMD window and at "E:\My Music\" prompt, typed: "dir *. /s" >dir.txt" in order to generate a text file of all folders and subfolders under "My Music". When I reviewed the dir command output I found some cases where the folder name is omitted from the higher level output but appears in the lower level. So it would look like this:


    My Music\ABC


    My Music\ABC\123

    My Music\ABC\456

    My Music\ABC\789


    My Music\ABC\123\aaa

    My Music\ABC\123\bbb

    My Music\ABC\123\ccc


    My Music\ABC\456\aaa
    My Music\ABC\456\bbb

    My Music\ABC\456\ccc


    My Music\ABC\789\aaa

    My Music\ABC\789\bbb

    My Music\ABC\789\ccc

    My Music\ABC\012


    My Music\ABC\012\111

    My Music\ABC\012\222

    My Music\ABC\012\333


    As you can see, the problem is that a level of subfolder is omitted from the top level of the DIR output, despite the fact that it is shown in the lower down levels of the DIR output. "My Music\ABC\012" should have been at the bottom of the first section of the DIR output, below the line "My Music\ABC\789". It will make it much easier if I could get a consistent output from my DIR command. By the way, I did check to see that the affected files and folder didn't have Hidden attribute. Also, so far, this has only affected about 2 out of around 30 folders, really have no idea what to do to fix this.

    :)
     
    RichardReithner, Jun 14, 2020
    #1
  2. Kari Win User

    dir Difficulties

    DIR uses whatever time definition you tell it to use. Following command would list all files and folders in X:\Downloads in order they have been created:

    dir X:\Downloads /t:c


    DIR is fully capable to sort files and folders. Following command would list all files in X:\Downloads, oldest first:

    dir X:\Downloads /o:d

    The minus sign before a parameter reverses the results, so the following command would list the same folder in reversed order, newest first:

    dir X:\Downloads /o:-d

    You can also combine switches. Following command would list all files and folders in X:\Downloads and all its subfolders (the /s switch), listing them in newest first based on time of file / folder creation:

    dir X:\Downloads /s /o:-d /t:c
     
  3. dir Difficulties

    I am getting the hang of this command set.

    Maybe somebody know a work around that will list the three time stamps at one time.
    Theoretically dir /TC /TA /TW.
    dir will only show one of the three at one time.

    To me it seems that the only way to get all three on a line is to run loop with output to file, then boiling down the three outputs to one line. Clumsy but maybe the only way to get the job done?

    Thanks for any suggestions.
     
    mikeincousa, Jun 14, 2020
    #3
  4. DOS Dir Command issues-dir *. /s doesn't get all subfolders?

    list contents similar to Dir command by Windows built in "Kind"

    I've been searching for a way to print a listing of folder and subfolders and only want a certain kind, based on Windows built in "Kind" associations.

    I know how to do the dir command to print a listing of a folder and how to use the dir command to list only a certain type.

    What I am hoping for is someone out there might know of a way to make a printout or a file of the listings of a certain "kind" based on the associations that are setup in Windows.

    For example, if you use Explorer to search, you can by kind (Documents, movies, videos, music, etc), or type (*.exe, *.avi, *.mp3, *.txt, *.doc, etc)

    I've tried to search using various terms here, on Bing, Google, etc and it's just not taking me anywhere that might give me help. I've even looked for powershell scripts someone might have posted to do the job.

    Prefer to not install 3rd party software to do the trick but use Windows built in solutions but am open to suggestions as a last resort.
     
    Paul_W_Chambers, Jun 14, 2020
    #4
Thema:

DOS Dir Command issues-dir *. /s doesn't get all subfolders?

Loading...
  1. DOS Dir Command issues-dir *. /s doesn't get all subfolders? - Similar Threads - DOS Dir Command

  2. chkdsk and dir commands report different free space

    in Windows 10 Drivers and Hardware
    chkdsk and dir commands report different free space: Hello, I would like to know why is there different free space reported by chkdsk and dir commands. I created a compressed NTFS drive and have one folder with files in it. There are no errors on drive at least as reported by chkdsk: x:\>chkdsk x: The type of the...
  3. Bug in the DIR command?

    in Windows 10 Network and Sharing
    Bug in the DIR command?: Hi all. I'm running Version 10.0.17134.1365 and recently I've been testing long file names and how they're handled in an application that I work on. Strangely I noticed that when I try to see what the short name is for one of these files, they're not displaying correctly....
  4. DIR commands

    in Windows 10 Ask Insider
    DIR commands: So recently I used the DIR commands to be able to see hidden and Invisible files, is there any way to revert this? submitted by /u/Creeper_King_558 [link] [comments] https://www.reddit.com/r/Windows10/comments/inyfq2/dir_commands/
  5. DIr Vexation / Alternates?

    in Windows 10 Support
    DIr Vexation / Alternates?: I want output all of the files in my document tree by Date Created, and have them format into a tight list in ascending chronological order The dir B switch gives me a nice tight list but I have not been able to figure out how to put it in oldest to newest order. Examples...
  6. Windows dir name

    in Windows 10 Installation and Upgrade
    Windows dir name: My computer will not start. My probing has revealed that Windows is "gone" Where it's supposed to be is a dir called"$WINDOWS.·-BT" I can't get the squiggly line to type. 1.what is the correct name of the Windows 10 directory? 2. How do I change it in the CMD prompt?...
  7. Dir command gives unexpected / unwanted results

    in Windows 10 Support
    Dir command gives unexpected / unwanted results: If I open a command prompt window and give the command " dir *.xls", I also get all xlsm, xlsx, xlsq etc files. This behaviour is unwanted and illogical. it makes scripting hopelessly complex and unreliable. If I wanted those files, I would issue a "dir *.xls?" command. For...
  8. dir Difficulties

    in Windows 10 Support
    dir Difficulties: I am seeking to sort files with dir. Creation date and time is my most primary interest. This has been my primary guide. MS-DOS dir command help I have tried a number of these commands in Powershell and Admin Powershell The simple one element wild card ones work okay. Ex...
  9. Hidden char in file name showed by command dir

    in Windows 10 Support
    Hidden char in file name showed by command dir: Hi, In tracking a bug in app, I discovered something very odd. I have a strange file name in a directory. If I do a dir command the file name appearing is not the same as with Win Explorer! Even the copy paste from the console removes the extra char. Attached...
  10. matching wildcards in dir

    in Windows 10 Support
    matching wildcards in dir: In a folder I have several files starting with test, like test00, test0000, test1.txt, test1111, test 01.txt If I do a dir test0* I expect to get all files which match test0* like test00 and test0000 but I also get test 01.txt and I'm not sure why. I mean "test 01.txt"...