1.打开xp_cmdshell
EXEC sp_configure'show advanced options', 1
GO
-- To updatethe currently configured value for advanced options.
RECONFIGURE
GO
-- To enablethe feature.
EXEC sp_configure'xp_cmdshell', 1
GO
-- To updatethe currently configured value for this feature.
RECONFIGURE
GO
-- To disallowadvanced options to be changed.
EXEC sp_configure'show advanced options', 0
GO
-- To updatethe currently configured value for advanced options.
RECONFIGURE
GO
2.
exec master..xp_cmdshell'net use z: \\远程IP\ 远程共享目录"用户密码" /user: user:远程IP \Administrator'
3.建立维护计划任务可以选用磁盘映射 若没有执行前两步,在选择磁盘时则找不到远程共享目录
建立备份
--如果要禁用,
-- To allow advanced options to bechanged.
EXEC sp_configure'show advanced options',1
GO
-- To update the currently configuredvalue for advanced options.
RECONFIGURE
GO
-- To disable the feature.
EXEC sp_configure'xp_cmdshell', 0
GO
-- To update the currently configured valuefor this feature.
RECONFIGURE
GO
-- To disallow advanced options to bechanged.
EXEC sp_configure'show advanced options',0
GO
-- To update the currently configuredvalue for advanced options.
RECONFIGURE
GO
本文档详细介绍了如何在SQL Server中启用和使用xp_cmdshell扩展存储过程,包括配置高级选项、启用功能、禁用功能等步骤,并提供了通过xp_cmdshell进行网络映射的具体示例。
1175

被折叠的 条评论
为什么被折叠?



