In my Windows Server 2008, I am having physical drives with letters 'C:', 'D:', 'E:', 'H:' and 'Z:' and DVD drive holds letter 'G:' and also having network drive with letter 'Y:'
If I execute the below query in command prompt
wmic LOGICALDISK LIST INSTANCE
I will get the result

But if run the below query in SQL Server 2008 in the same server. The network drive letter is missing in the output
EXEC master..xp_cmdshell 'wmic LOGICALDISK LIST INSTANCE'
The result is

Mapped drives are mapped by user token. SQL Server almost never runs as a user, so has no access to user drive mappings.
Administrator have two user tokens. A limited user one and an administrator one. A mapped drive only applies to the user token that mapped it. Older windows won't let it be mapped by both tokens.
Mapped drives became obsolete around 1995. Yet bizarrely they live on. Use UNC naming \\servername\sharename\foldername\filename.ext.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With