vbscript - 任务杀手脚本问题
问题描述
我在 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
解决方案
推荐阅读
- perl - perl 版本 5.24.1 中 perl 模块 `Getopt::Long::Subcommand` 的不正确行为
- vb.net - 如何使用vb.net在excel单元格中粘贴以逗号分隔的十进制数字
- python - 如何迭代字典中一个键的值列表
- unity3d - 如何在tilemap中动态设置tile?
- javascript - 如何使画布宽度和高度适合Vuetify中的父元素?
- java - 在 fxml 加载后获取节点的子节点
- bash - For循环 - 复制多个文件并在不同的目录中重命名扩展名
- spring-boot - docker 容器中的 H2 DB
- javascript - 使用 Azure 函数的动态输出 blob 路径
- jquery - 考虑到 thead 和 tbody 添加具有 td 索引的行