ZTree.com  | ZEN  | About...  

 Index   Back

Use powershell   [Q]

By: Ben Kent       
Date: Dec 23,2018 at 06:18
In Response to: [Q] Windows DIR *sh*.* still locates a file like "presenta.shw" from the extension (Ryan)

> hi
> ztree's filter is more like DOS.
> ztree's filter *sh* or *sh*.* does not locate a file like
> "presenta.shw", and this is what i want.
> but from XP to win10's commands
> dir *sh*
> dir *sh*.*
> still locate a file like "presenta.shw" taken from the extension
> in other words, there is no way not to find files from their extensions
> like "presenta.shw" under windows DIR commands i know. this is causing
> a big mess.
> is there a way in windows to do it like ztree or DOS 6.22?
> is there a way in windows not to match a string from a file extension?


From what I get tell Microsoft have given up maintaining cmd.exe, so your not going to get it fixed, as changing the behavior to be correct will brake some peoples code that rely on the incorrect processing.

The future is powershell, where this command only matches in the name part
Get-ChildItem *sh*.*

Also in powereshell you can also filter using Regular Expressions
Get-ChildItem ..... | Where-Object { {$_.BaseName -match "regex"}


Thread locked

Messages in this Thread

95,075 Postings in 11,986 Threads, 350 registered users, 33 users online (1 registered, 32 guests)
Index | Admin contact |   Forum Time: Aug 13, 2020 - 3:34 pm EDT  |  Hits:33,092,807  (16,729 Today )
RSS Feed