Programatically check whether a drive letter is a shared/network drive

Posted by Philip Daubmeier on Stack Overflow See other posts from Stack Overflow or by Philip Daubmeier
Published on 2010-04-30T10:05:50Z Indexed on 2010/04/30 10:27 UTC
Read the original article Hit count: 383

Hi SO community!

I searched a while but found nothing that helped me. Is there a way to check whether a drive letter stands for a shared drive/network drive or a local disc in python? I guess there is some windows api function that gives me that info, but I cant find it. Perhaps there is even a method already integrated in python?

What I am looking for is something with this or similar behaviour:

someMagicMethod("C:\")  #outputs True 'is a local drive'
someMagicMethod("Z:\")  #outputs False 'is a shared drive'

That would help me as well:

someMagicMethod2()  #outputs list of shared drive letters

Thanks a lot in advance!

© Stack Overflow or respective owner

Related posts about python

Related posts about network-drive