Currently I'm using System.IO.Directory.Exists("Z:\\")
to check. However, it still returns true
even after I have disconnected the network drive using File Explorer. It also still returns true after I have mapped it programmatically eventhough the Z Drive isn't showing in File Explorer.
How do I check whether the network drive is mapped by using c# or by using the command line?
My OS is Windows 10