启用、关闭xp_cmdshell

来源:互联网 发布:甲醛检测仪数据怎么看 编辑:程序博客网 时间:2024/05/19 23:54
--启用xp_cmdshell
USE master 
EXEC sp_configure 'show advanced options', 1 
RECONFIGURE WITH OVERRIDE 
EXEC sp_configure 'xp_cmdshell', 1 
RECONFIGURE WITH OVERRIDE 
EXEC sp_configure   'show advanced options', 0
RECONFIGURE WITH OVERRIDE 

--关闭xp_cmdshell
USE master 
EXEC sp_configure 'show advanced options', 1 
RECONFIGURE WITH OVERRIDE 
EXEC sp_configure 'xp_cmdshell', 0 
RECONFIGURE WITH OVERRIDE 
EXEC sp_configure   'show advanced options', 0

RECONFIGURE WITH OVERRIDE 


输出:(关闭时)

配置选项 'show advanced options' 已从 1 更改为 1。请运行 RECONFIGURE 语句进行安装。
配置选项 'xp_cmdshell' 已从 1 更改为 0。请运行 RECONFIGURE 语句进行安装。
配置选项 'show advanced options' 已从 1 更改为 0。请运行 RECONFIGURE 语句进行安装。

原创粉丝点击