关于xp_cmdshell
在SQL Server Management里执行以下的命令
EXEC master.sys.xp_cmdshell 'EVENTCREATE /L APPLICATION /T INFORMATION /SO TEST /ID 100 /D "成功"'
go
结果显示的是已经成功添加了windows 事件。但是去windows事件查看器里面看确没有。
请大虾指点。
------解决方案--------------------楼主是win xp系统吗?请检查语法是否正确
Syntax
eventcreate [/s Computer [/u Domain\User [/p Password]] {[/l {APPLICATION
------解决方案--------------------SYSTEM}]
------解决方案--------------------[/so SrcName]} /t {ERROR
------解决方案--------------------WARNING
------解决方案--------------------INFORMATION
------解决方案--------------------SUCCESSAUDIT
------解决方案--------------------FAILUREAUDIT} /id EventID /d Description
------解决方案--------------------去掉描述试试
EXEC master.sys.xp_cmdshell 'EVENTCREATE /L APPLICATION /T INFORMATION /SO TEST /ID 100'
------解决方案--------------------例子:
eventcreate /t error /id 100 /l application /d "Create event in application log"
eventcreate /t information /id 1000 /so winmgmt /d "Create event in WinMgmt source"
eventcreate /t error /id 2001 /so winword /l application /d "new src Winword in application log"
eventcreate /s server /t error /id 100 /l application /d "Remote machine without user credentials"
eventcreate /s server /u user /p password /id 100 /t error /l application /d "Remote machine with user credentials"