0

A network drive is mapped on our application server and drive name is Z. When i am trying to get drives information am not getting Mapped drive(Z). Tried with below code.

 DriveInfo[] allDrives = DriveInfo.GetDrives();
        Response.Write("Drives Present in Server: </br>");
        foreach (DriveInfo d in allDrives)
        {
            Response.Write("---Drive Name: " + d.Name + " Drive Type: " + d.DriveType + "</br>");                
        }

How do i get this mapped drive.

user1463065
  • 489
  • 1
  • 9
  • 26
  • https://stackoverflow.com/questions/12029855/why-does-driveinfo-getdrives-not-get-network-mapped-drive-in-windows-service – Roman Ryzhiy Jan 20 '21 at 09:04
  • https://social.msdn.microsoft.com/Forums/vstudio/en-US/e5b3ee65-4d08-4ee5-bba5-60a2a5b50d07/why-driveinfogetdrives-not-getting-networkmapped-drive-in-windows-service-which-i-developed-in – Roman Ryzhiy Jan 20 '21 at 09:05
  • 1
    There's no such thing as a network drive. Mapped drives aren't real drives, they're (roughly) user-specific shortcuts that point to shared folders on a remote server. Why don't you use the actual shared folder path? – Panagiotis Kanavos Jan 20 '21 at 09:09
  • Windows does have a [distributed file system](https://docs.microsoft.com/en-us/windows-server/storage/dfs-namespaces/dfs-overview), which doesn't work through mapped drives at all. – Panagiotis Kanavos Jan 20 '21 at 09:10

0 Answers0