MAP Network Drive in SQL Management Studio

First you need to change the permissions to allow xp_cmdshell:
[code language=”sql”]
— To allow advanced options to be changed.
EXEC sp_configure ‘show advanced options’, 1
GO
— To update the currently configured value for advanced options.
RECONFIGURE
GO
— To enable the feature.
EXEC sp_configure ‘xp_cmdshell’, 1
GO
— To update the currently configured value for this feature.
RECONFIGURE
GO
[/code]
Now you can map a network drive:
[code language=”sql”]
use master
go
exec xp_cmdshell ‘net use X: \path'[/code]

Share

Leave a Reply