通过 PID windows javascript 查询进程
我在 Windows 上有一些进程并且有 pid。它正在机器上运行。
- 如果带有pid的进程已启动,如何使用js查询?
- 我可以在js中确保这是该进程(而不是其他进程)
I have a few processes on windows and have there pid. It is RUNNING on the machine.
- How can I query using js if the a process with the pid is up ?
- Can I ensure in js that this the process (and not other process)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 WMI 通过 ID 获取进程的句柄:
您可以从结果对象中访问一些不同的属性,例如
Caption
或ExecutablePath
,以确保这是您正在寻找的过程:You can get a handle to a process by its ID using WMI:
There are a few different properties you can access from the resulting object, such as
Caption
orExecutablePath
, to make sure it is the process you're looking for:JavaScript 本身无法访问操作系统。但是,如果您使用服务器端 JavaScript,您也许能够从 RingoJS 或 Node.js 访问系统调用。请提供有关您正在使用的环境的更多详细信息。
JavaScript doesn't natively have access to the Operating System. However you may be able to access system calls from RingoJS or Node.js, if you're using Server Side JavaScript. Please provide more details about the environment you're using.