Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I copy all files that match a filter and the directory structure to UNC path will powershell:

For example with the filter as "*2011_01_02*.bak":


To \\\meow\ with the result of:

share|improve this question
It sounds like it's raining cats and dogs over by you guys... – Holocryptic May 20 '11 at 16:23

How about:

Copy-Item . -Destination "\\\meow\" -Filter "*2011_01_02*.bak" -Recurse

(Based on some fiddling on a test box.)

share|improve this answer

Using robocopy, something like the following does the trick:

Robocopy.exe .\ \\\meow *.ps1 /S

Not powershell, but seems to do the trick.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.