Speed up File.Exists for non existing network shares

In a nutshell

  1. Build a list of available drives.
  2. Try to resolve the driveletter to an UNC name.
  3. Try to ping the drive.

Edit regarding Bill’s comment

if Google is not the referer, EE doesn’t show the answer for free. Links to EE are not helpful.

OP found the article I’ve mentioned in my original answer and was kind enough to include the source code for the solution to his question.

Leave a Comment