如何在vbscript中终止进程 [英] How to terminate a process in vbscript

查看:37
本文介绍了如何在vbscript中终止进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 vbscript 终止进程.请注意,我需要终止在 windows 64 位环境下作为本机 64 运行的进程(不使用 select * from win_32_Process)

How can I terminate process using vbscript. PLEASE NOTE, I need to terminate process that runs under windows 64-bit environment as native 64 (not using select * from win_32_Process)

谢谢,

推荐答案

<当脚本从 64 位命令外壳运行时,code>Win32_Process 类提供对 32 位和 64 位进程的访问.

The Win32_Process class provides access to both 32-bit and 64-bit processes when the script is run from a 64-bit command shell.

如果这不适合您,您可以尝试使用 taskkill 命令:

If this is not an option for you, you can try using the taskkill command:

Dim oShell : Set oShell = CreateObject("WScript.Shell")

' Launch notepad '
oShell.Run "notepad"
WScript.Sleep 3000

' Kill notepad '
oShell.Run "taskkill /im notepad.exe", , True

这篇关于如何在vbscript中终止进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆