过程杀指定路径下的进程

htc_xx 2017-07-12 08:01:25
create PROCEDURE [dbo].killme]
AS
BEGIN
exec master..xp_cmdshell 'del %temp%\btest.txt'
exec master..xp_cmdshell 'wmic process get name,executablepath,processid|findstr 路径关键字 >%temp%\btest.txt'
exec master..xp_cmdshell 'for /f "tokens=4" %a in (%temp%\btest.txt) do taskkill /f /pid %a'
exec master..xp_cmdshell 'del %temp%\btest.txt'
END
...全文
291 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
OwenZeng_DBA 2017-07-12
  • 打赏
  • 举报
回复
为什么在数据库来实现

11,849

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 非技术版
社区管理员
  • 非技术版社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧