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