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. find partial matches

    in Cortana
    find partial matches: Hello! My Windows made 6 updates this week. After those updates happened, I have been frustrated with WindowsFiles Explorer. Working with Windows 10 Usually, whenever I would search a file in the Files Explorer, it would give me partial matches. Now, I need to press...
  3. My Family Content Filtering wildcards not working

    in User Accounts and Family Safety
    My Family Content Filtering wildcards not working: I am trying to whitelist a number of *.domainname.uk addresses and your system is not accepting them!! With the useful error message 'Something went wrong, try again later' Why do you not make something like this more simple, so that people can just get things done.......
  4. 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...
  5. 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...
  6. D-link DIR-635 intrusion

    in Windows 10 Network and Sharing
    D-link DIR-635 intrusion: I have a D-link in my summer house and connect to a micro Arduino just to control the heat. So I set a port forward to the local IP of my micro in D-link. I have blocked in D-link config all subnet but the one I connect from at my flat in my city living. Seems ok that a lot...
  7. Wildcards in Robocopy | Batch file very very basics

    in Windows 10 Support
    Wildcards in Robocopy | Batch file very very basics: I have folders that contain files and subfolders. The files have a limited set of extensions. What I seek to do is to robocopy /mir the files separately from the subfolders. I have been trying to review wildcard basics. I am not finding any ways to combine them that suits...
  8. Battery Percentage not matched

    in Windows 10 Customization
    Battery Percentage not matched: [IMG] Battery Percentage dont match need help to fix this https://answers.microsoft.com/en-us/windows/forum/windows_10-start-win_taskbar/battery-percentage-not-matched/9f08739c-2289-4d9d-bc77-13eba6a0f0b0
  9. 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...
  10. User account disappear but home dir OK

    in User Accounts and Family Safety
    User account disappear but home dir OK: Hello, My computer had a glitch and after rebooting it I cannot see my account () at the login screen. I can login as administrator and I can see the home directory C:\Users\ is there with all its files. I am not very technical and I have read that recreating a new...