xp_cmdshell。对'CreateProcess'的调用失败,错误代码:'2'



当我在SQL Server 2008中执行以下语句时:

use master
go
exec sp_configure 'show advanced options', 1;
go
reconfigure
go
exec sp_configure 'xp_cmdshell',1;
go
reconfigure
go
EXEC XP_CMDSHELL 'whoami'

它给出以下错误:

Msg 15121,Level 16,State 21,Procedure xp_cmdshell,Line 1错误在执行xp_cmdshell期间发生。呼叫"CreateProcess"失败,错误代码为:"2"。

请帮我解决这个问题。

非常感谢。

错误代码5表示访问被拒绝。

请检查用于MSSQL服务的帐户是否有权执行您尝试运行的命令。

详细信息:http://social.msdn.microsoft.com/Forums/sqlserver/en-US/bbdffb3c-6604-4011-ac5f-5ea8ecb1a32c/xpcmdshell-a-call-to-createprocess-failed-with-error-code-5-under-sql2005-rtm?forum=sqlsecurity

最新更新