ZTree.com  | ZEN  | About...  

 Index   Back

Use powershell   [Q]

By: Ben Kent       
Date: Dec 23,2018 at 11: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

986 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 68 users online (0 registered, 68 guests)
Index | Admin contact |   Forum Time: Mar 29, 2024 - 12:50 am UTC  |  Hits:62,386,399  (1,185 Today )
RSS Feed