当作为批处理文件启动变更进程名 [英] Change process name when launched as batch file

查看:119
本文介绍了当作为批处理文件启动变更进程名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作被称为Nagios的这对于Unix和Windows服务器的监控服务监控系统。问题是,通过批处理文件启动任务管理器被命名为cmd.exe的WINDOWS服务,使监控系统时无法这些服务区分开来。

I'm working on a monitoring system called "Nagios" which monitors services for UNIX and WINDOWS servers. Problem is WINDOWS services that are launched by batch files are named in task manager as "cmd.exe", so system can't distinguish between these services when monitoring.

启动它时,所以每个人都有一个唯一的名称,而不是cmd.exe的?

How can I change a process name on task manager when launching it so each one has a unique name rather than "cmd.exe"?

感谢您提前。

推荐答案

您可以运行批处理文件作为窗口服务,使进程名称。您可以设置开始和停止发生什么。您可以使用它的PID杀死服务。

You can run batch file as windows service to make a process name. You can set what to happen on start and on stop. You can kill the service using its PID.

C#教程创建批处理文件作为Windows服务。

C# Tutorial to create batch file as windows service.

这篇关于当作为批处理文件启动变更进程名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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