I need to copy all text files on one folder whose names are five characters long. I know this command is for listing:
$ dir folder /B | findstr /R "^.....\.txt"
but I want to copy all files whose names are listed by the above command
to a different folder.
Best Answer
I was asking (not only to myself) "doesn't it work a simple..."?
Thanks to G-Man it is tested that in powershell it works, meanwhile in cmd.exe the above command will copy each match up to five characters and with all the extension that start with
.txt
.Reference:
Wildcards under windows.
Powershell, text and regular expressions.