This will find and copy files with the specified search param.
public static void findAndCopy(string _sourcePath, string _destPath, string _searchParam ) { if (System.IO.Directory.Exists(_sourcePath)) { string[] files = System.IO.Directory.GetFiles(_sourcePath, _searchParam, System.IO.SearchOption.AllDirectories); string destFile = ""; string fileName = ""; // Copy the files foreach (string s in files) { // Use static Path methods to extract only the file name from the path. fileName = System.IO.Path.GetFileName(s); destFile = System.IO.Path.Combine(_destPath, fileName); try { System.IO.File.Copy(s, destFile, false); } catch (UnauthorizedAccessException uae) { log.Warn(uae); } catch (IOException ioe) { log.Warn(ioe); } } } else { log.Error("Source path not found! " + _sourcePath); } }//end findAndCopy