dir search for ~

Associate
Joined
14 Mar 2018
Posts
33
Hi folks using dir I need to search for files named test~test.txt for example.
Tried dir *~* /s /b which does not work and returns every thing. Yet for other special chars this does work
dir *!* "*&*" /s /b
and returns correct result.

Thanks
 
Man of Honour
Joined
13 Oct 2006
Posts
91,164
~ is probably filtering all filenames above 8 characters long due to the way long filenames are handled - sticking with DOS you might need to capture the dir output then filter for filenames with ~ which is a bit of a longer script.
 
Back
Top Bottom