0

I have a fileshare server \\fileshareserver.abc.net and am accessing data in it using C#.

I'm calling the Directory.EnumerateFiles method to enumerate all the file under a directory.

When I call a subdirectory under the above fileshare such as \\fileshareserver.abc.net\SubDirectory\, the enumerate files method works fine. But when I call it on the fileshare root as \\fileshareserver.abc.net then it throws the error: The specified path is invalid. : \\fileshareserver.abc.com

  • If you're doing as you described above, it seems that the issue may be that your file share server is: `\fileshareserver.abc.net` and you're trying to access it using `\\fileshareserver.abc.com`. – Tu deschizi eu inchid Jun 20 '22 at 13:07
  • 1
    It's necessary to specify either a drive name or a folder name. Sharing the entire drive is not a good idea from a security standpoint. However, a drive letter can be accessed by using `$` (ex: `C$`). The following may be helpful: [Why are these folders' share names appended with dollar signs?](https://stackoverflow.com/questions/448371/why-are-these-folders-share-names-appended-with-dollar-signs#:~:text=The%20%24%20in%20SMB%2FCIFS%20URIs,displayed%20when%20browsing%20shared%20folders.) – Tu deschizi eu inchid Jun 20 '22 at 13:39
  • 1
    Also I don't think you can enumerate a whole server using `\\`, it has to be a file share on that server – Charlieface Jun 20 '22 at 13:51

0 Answers0