Search code examples
processbatch-filemonitoringnagios

Change process name when launched as batch file


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.

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

Thank you in advance.


Solution

  • 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# Tutorial to create batch file as windows service.