Windows 10: matching wildcards in dir

Discus and support matching wildcards in dir in Windows 10 Support to solve the problem; 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... Discussion in 'Windows 10 Support' started by RonNewYork, Oct 9, 2017.

  1. 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" to my thinking should not match test0*, right? wrong?

    I've been programming and using Windows since NT so now I feel kind of stupid.

    Or not??

    RON

    :)
     
    RonNewYork, Oct 9, 2017
    #1

  2. Results of a filename search giving unrelated results along with correct results

    The 8.3 file name probably contains the string "0288". You can find out with this Console command:

    dir /x 0857*.*

    Please post the exact location of these files if you need more detailed instructions.
     
    Frederik Long, Oct 9, 2017
    #2
  3. Can't delete .exe file - "Could not find this item","This is no longer located in C:\Users\Owner\Downloads." "Verify the item's location and try again."

    I solved this problem by using the DEL command with a wildcard *

    Open a command window and run as administrator. Navigate to the location of the offending file

    Example:

    Where test. is the problem file

    c:\Users\test\AppData\Local\Temp\

    at the prompt type DEL and then the file name followed by the wildcard

    DEL test*

    and return

    All files with the name test and any extension, (including none) will be deleted

    type DIR to verify the file has been deleted.

    You can now delete any folder structure that remains
     
    DMcDonaldCA, Oct 9, 2017
    #3
  4. lx07 Win User

    matching wildcards in dir

    For me dir works as expected in powershell but not cmd.

    cmd ignores the space in the filename (but not in the comparator eg dir "d:\temp\test "*)

    Code: Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. PS C:\WINDOWS\system32> dir d:\temp Directory: D:\temp Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 10-Oct-17 22:09 6 test 0.txt -a---- 10-Oct-17 22:24 0 test 2.txt -a---- 10-Oct-17 22:04 6 test0.txt -a---- 10-Oct-17 22:04 6 test01.txt -a---- 10-Oct-17 22:24 0 test2.txt PS C:\WINDOWS\system32> dir d:\temp\test0* Directory: D:\temp Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 10-Oct-17 22:04 6 test0.txt -a---- 10-Oct-17 22:04 6 test01.txt PS C:\WINDOWS\system32> cmd Microsoft Windows [Version 10.0.16299.15] (c) 2017 Microsoft Corporation. All rights reserved. C:\WINDOWS\system32>dir d:\temp\test0* Volume in drive D has no label. Volume Serial Number is 646D-8050 Directory of d:\temp 10-Oct-17 22:04 6 test0.txt 10-Oct-17 22:04 6 test01.txt 10-Oct-17 22:09 6 test 0.txt 3 File(s) 18 bytes 0 Dir(s) 30,857,822,208 bytes free C:\WINDOWS\system32>dir "d:\temp\test "* Volume in drive D has no label. Volume Serial Number is 646D-8050 Directory of d:\temp 10-Oct-17 22:09 6 test 0.txt 10-Oct-17 22:24 0 test 2.txt 2 File(s) 6 bytes 0 Dir(s) 30,857,822,208 bytes free C:\WINDOWS\system32>dir "d:\temp\test0"* Volume in drive D has no label. Volume Serial Number is 646D-8050 Directory of d:\temp 10-Oct-17 22:04 6 test0.txt 10-Oct-17 22:04 6 test01.txt 10-Oct-17 22:09 6 test 0.txt 3 File(s) 18 bytes 0 Dir(s) 30,857,822,208 bytes free[/quote] Not sure of the solution (except to use powershell)
     
    lx07, Oct 9, 2017
    #4
  5. THANKS! That "cleared" it up. I mean, it is something for some reason I never knew. Unfortunately this is not being run in either CMD or Powershell but in .NET/C#.

    It's not a problem in my code, I was just surprised.

    Well, it could be a problem for users who expect one thing and get another. If so I'll show them your explanation.

    RON
     
    RonNewYork, Apr 4, 2018
    #5
Thema:

matching wildcards in dir

Loading...
  1. matching wildcards in dir - Similar Threads - matching wildcards dir

  2. 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....
  3. Is there a wildcard for the year within a date search?

    in Windows 10 Support
    Is there a wildcard for the year within a date search?: Hello I would like to search for all my photos taken on a specific day, regardless of year e.g. return all photos taken on the 25 December of any year. I am trying to do this with the datetaken property but I can't figure out the wildcard for the year. I have tried:...
  4. Wildcard for website blocking?

    in User Accounts and Family Safety
    Wildcard for website blocking?: I am trying to block a gaming website using the Microsoft Family Safety "Web Browsing" feature, but it doesn't seem to be accepting a wildcard so that I can block all subdomains of the website, of which there are many. If I enter a specific subdomain it works fine, but...
  5. 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/
  6. 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...
  7. Qualified Path Wildcard?

    in Windows 10 Support
    Qualified Path Wildcard?: Microsoft Windows Version 10.0.18363.836 1909 Pro Administrator: Admin cmd C:\>"C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.2005.5-0\MpCmdRun.exe" -SignatureUpdate Signature update started . . . Signature update finished. C:\>"C:\ProgramData\Microsoft\Windows...
  8. Wildcard Selection in Explorer

    in Windows 10 Software and Apps
    Wildcard Selection in Explorer: Is there an app or program that allows wildcard selection of items in explorer before a copy/cut/ action? Right click or menu bar or both. Alternatively, does anyone recommend a good shell extension coder that can help? I found code for a context menu wild card selection...
  9. Shell Extension for Wildcard Selection

    in Windows 10 Customization
    Shell Extension for Wildcard Selection: Good afternoon all. Please see this article codeproject dated around 2002 providing binaries and code to a wildcard selection right context menu option. As far as I know, this functionality is not native to the Explorer GUI, only the command, correct? Windows Explorer...
  10. 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...