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?

Ryan

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"}

Ben

239 views      
Thread locked
 

Messages in this Thread

 
94,579 Postings in 11,930 Threads, 348 registered users, 13 users online (0 registered, 13 guests)
Index | Admin contact |   Forum Time: Nov 14, 2019 - 10:52 am EST  |  Hits:29,095,354  (5,270 Today )
RSS Feed