What do you mean by "service"? Windows services? API services hosted on a remote server?
I wouldn't recommend using a batch file in any app unless you absolutely need to. There is no benefit and it is harder to do. If you want to get Windows services then you can use the System.ServiceProcess.ServiceController
class. However this is a Windows-only thing so you'll need to properly wrap this in platform code. You'll also need to add a NuGet package for System.ServiceProcess
. After that however you can get the service(s) you care about and check their status.