 <p>Try this:</p> <pre><code>foreach (string file in Directory.EnumerateFiles(folderPath, "*CustsExport*.xml")) { } </code></pre> <p>Or your can use regex:</p> <pre><code>Regex reg = new Regex(@".*CustsExport.*\.xml",RegexOptions.IgnoreCase); var files = Directory.GetFiles(yourPath, "*.xml") .Where(path =&gt; reg.IsMatch(path)) .ToList(); </code></pre>