在服务器上运行:
EXEC sp_configure 'show advanced options', 1; GO RECONFIGURE; GO EXEC sp_configure 'xp_cmdshell',1 GO RECONFIGURE GO
EXEC XP_CMDSHELL 'net use B: \\RemoteServerName\ShareName password /user:domain\username'
在服务器上运行:
EXEC sp_configure 'show advanced options', 1; GO RECONFIGURE; GO EXEC sp_configure 'xp_cmdshell',1 GO RECONFIGURE GO
EXEC XP_CMDSHELL 'net use B: \\RemoteServerName\ShareName password /user:domain\username'
转载于:https://www.cnblogs.com/lionetchen/p/7478249.html