Windows 10: Dir command gives unexpected / unwanted results

Discus and support Dir command gives unexpected / unwanted results in Windows 10 Support to solve the problem; 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... Discussion in 'Windows 10 Support' started by tfor, Feb 26, 2019.

  1. tfor Win User

    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 the record: *.xlsq is NOT an existing Excel extension. I created an empty file with that extension to test this behaviour.

    Issuing the command "dir *.xl" gives me no results.

    Is there any way to make Windows list only .xls files, and not .xls? files?

    I suppose the same applies to Word and PowerPoint files. I have not tested this yet.

    :)
     
  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. 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, Feb 26, 2019
    #3
  4. Dir command gives unexpected / unwanted results

    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, Feb 26, 2019
    #4
Thema:

Dir command gives unexpected / unwanted results

Loading...
  1. Dir command gives unexpected / unwanted results - Similar Threads - Dir command unexpected

  2. DIR Command

    in Windows 10 Gaming
    DIR Command: dir /A:D /B /S > FolderList.txt produces a list of all directories and subdirectories of a directory. I would like to modify this line to have the date included for all directories and subdirectories of a directory too....
  3. DIR Command

    in Windows 10 Software and Apps
    DIR Command: dir /A:D /B /S > FolderList.txt produces a list of all directories and subdirectories of a directory. I would like to modify this line to have the date included for all directories and subdirectories of a directory too....
  4. Command-line shells, commands like dir /p not working but dir does work

    in Windows 10 Customization
    Command-line shells, commands like dir /p not working but dir does work: I am using W'10, Administrative Windows Power Shell, command line.When I do a "DIR" it works, but when I add parameters, I get this error message:-----------------PS C:\> dir /sdir : Cannot find path 'C:\s' because it does not exist.At line:1 char:1+ dir /s+ ~~~~~~ +...
  5. Command-line shells, commands like dir /p not working but dir does work

    in Windows 10 Gaming
    Command-line shells, commands like dir /p not working but dir does work: I am using W'10, Administrative Windows Power Shell, command line.When I do a "DIR" it works, but when I add parameters, I get this error message:-----------------PS C:\> dir /sdir : Cannot find path 'C:\s' because it does not exist.At line:1 char:1+ dir /s+ ~~~~~~ +...
  6. Command-line shells, commands like dir /p not working but dir does work

    in Windows 10 Software and Apps
    Command-line shells, commands like dir /p not working but dir does work: I am using W'10, Administrative Windows Power Shell, command line.When I do a "DIR" it works, but when I add parameters, I get this error message:-----------------PS C:\> dir /sdir : Cannot find path 'C:\s' because it does not exist.At line:1 char:1+ dir /s+ ~~~~~~ +...
  7. 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....
  8. Mouse actions give unexpected results

    in AntiVirus, Firewalls and System Security
    Mouse actions give unexpected results: Many problems with mouse in Word, Excel, Thunderbird, even in this message: Selecting with mouse has become close to impossible: Make a selection, let go of mouse, and selection is partially or completely gone. If I manage to get a selection to stick on the desired text...
  9. 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/
  10. Bootrec commands giving unexpected responses

    in Windows 10 Installation and Upgrade
    Bootrec commands giving unexpected responses: After a fresh install of Windows 10 on my Acer Swift, I tried running the command: bootrec /scanos. This command however is showing 0 total Windows Installations. Windows boots and BIOS Settings appear normal. The computer can run updates and is currently up-to-date. This...