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. chkdsk /f gives result of orphaned files

    in Windows 10 Network and Sharing
    chkdsk /f gives result of orphaned files: hi, I ran chkdsk /f on my external HDD which was attached to a wifi router and I am using HDD on remote access and for internal LAN sharing of files too. However, I got problem with the HDD after running chkdsk /f function and it results saying there are 9 orphaned file...
  3. Changing file Icons (unexpected results)

    in Windows 10 Support
    Changing file Icons (unexpected results): Hello I've tried to change the file icons based on extensions(in Windows 10),for which I used a third party tool called FileTypes Man(I followed this guide), and at the first glance it works, until a system reboot at least. To be more precise, I am trying to change the PNG...
  4. "Mode" info returned by Windows 10 dir command

    in Windows 10 Support
    "Mode" info returned by Windows 10 dir command: Windows 10 seems to have a new set of info returned by the "dir" Powershell command. This appears under the "Mode" heading, e.g. -a---- or d----- , but nowhere have I found what these entries mean or how to interpret the individual characters. I get that they have to do with...
  5. Opening Network Folder Gives Inconsistent Results

    in Windows 10 Network and Sharing
    Opening Network Folder Gives Inconsistent Results: I have 3 Win 10 PCs. Two are WiFi-connected to my router (both to SSID = mywifi), the other one is Ethernet-connected. From Windows Explorer, when I open "Network" folder in PC#1 (wifi-connected) I see the other PC's along with everything else on the LAN, andI can browse,...
  6. "NET STATISTICS WORKSTATION" Command Prompt Command result reading

    in Windows 10 Network and Sharing
    "NET STATISTICS WORKSTATION" Command Prompt Command result reading: Hi, Here is the situation have several Windows 10 computers on domain network that contains 3 physical servers and 4 Virtual servers on 2 hyper v hosts. I should add the domain controller or active directory is a Virtual Machine on a hyper v host. Hyper v host 1 - AD 1...
  7. Cortana Not Showing Results,But Giving Voice Results

    in Windows 10 Software and Apps
    Cortana Not Showing Results,But Giving Voice Results: Hello ... I have problem with Cortana search results. When i give her voice command, she answering my question by voice but not showing results. here's the Screenshoot [img] 30985
  8. How to give a ".jar" command?

    in Windows 10 Support
    How to give a ".jar" command?: I am in the midst of transferring my iTunes playlists to an SD card and want to use the iTunes Export program (iTunes Export M3U Playist Exporter). It appears to to be simple to use, but one has to manually enter various commands on a command line. Here is an example of a...
  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. Differences in format of DOS command results

    in Windows 10 Support
    Differences in format of DOS command results: OK, so I am doing some stuff in DOS, not geeky stuff but playing around. I have two computers that I can use, both with W10. So, I do a 'DIR' command, saving to a file, and then look at it. Then same again on the other computer. It annoys me that the format of the results...