cmd - How do I iterate over files/directories with names that do not match a wildcard? -


from within batch script file, following code deletes folders begin name preceding *, denoting wildcard. how write loop iterates on files/folders don't match? eg; ![*abc]

rem remove unwanted files/directories  /d /r %%g in ("local\partialfilename*") (              rmdir /q /s %%g                   ) 

create temp dir, move matching files there, delete remain, , move them back. since move on same drive doesn't require copy, fast.

md ..\foo move *abc ..\foo rd . /s /q  move ..\foo\* . rd ..\foo 

the first rd command generate error message, can ignored.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -