获取正在运行的进程的可执行路径

发布于 2025-01-17 07:40:12 字数 508 浏览 4 评论 0原文

我希望获取正在运行的进程的可执行路径。假设我有两个 nginx 可执行文件正在运行。

C:/nginx/nginx.exe (or say usr/bin)
C:/second/nginx/nginx.exe (or say $home/local/nginx)

我希望获取正在运行的 nginx 文件的可执行文件路径,无论它是第一个还是第二个。我知道这个命令wmic process,其中“ExecutablePath like 'c:\\nginx\\nginx%'”在Windows中获取ProcessID。

有没有办法可以同时使用 Windows 和 Linux 的节点进程来做到这一点?我目前正在查看这个 - ps-node https://github .com/neekey/ps/issues/83

I wish to get the executable path of running process. Say I have two nginx executables running.

C:/nginx/nginx.exe (or say usr/bin)
C:/second/nginx/nginx.exe (or say $home/local/nginx)

I wish to get the executable's path of the running nginx file whether it is the first or second. I am aware of this command wmic process where "ExecutablePath like 'c:\\nginx\\nginx%'" get ProcessID in windows.

Is there a way I can do it using node process for windows and linux both together? I am currently looking at this - ps-node https://github.com/neekey/ps/issues/83

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文