USE master
GO
RECONFIGURE
GO
EXEC sp_configure ‘show advanced options’,1
GO
RECONFIGURE
GO
EXEC sp_configure ‘xp_cmdshell’,1
GO
RECONFIGURE
GO
EXEC sp_configure ‘show advanced options’,‘1’
GO
RECONFIGURE
GO
EXEC sp_configure ‘xp_cmdshell’,0 --关闭xp_cmdshell
GO
RECONFIGURE
GO
EXEC sp_configure ‘show advanced options’,‘0’ --关闭show advanced options
GO
RECONFIGURE
GO