首页 > 解决方案 > 任务杀手脚本问题

问题描述

我在 Windows 10 中找到了自动终止任务的代码,但我想终止的任务是:主机服务:本地系统,当我在做某事时会不断更新 Windows,主要问题是:它具有相同的名称(svhost.exe ) 作为其他进程。有什么办法可以解决这个问题吗?我还是个新手

set service = GetObject ("winmgmts:")
Dim oShell : Set oShell = CreateObject("WScript.Shell")

Do While 11>10
for each Process in Service.InstancesOf ("Win64_Process")
If Process.Name = "xxx.exe" then

oShell.Run "taskkill /im xxx.exe", , True
End If
next

WScript.Sleep 60000
Loop

标签: vbscript

解决方案


推荐阅读