title: How Can I use the SC command in a Batch to convert the Service Display Name to the Service Name?
body: <p>I have two parameters that are passed bye a service monitoring system. They are the Service Display Name and Machine name. I found the SC command can retrieve the service name via the GetKeyName. I have searched this site and others for a week and I'm stuck with how to extract output from that data to convert to a Service Start Command when the system is notified that a service is down.</p>
  
  <p>I am needing to create the batch/script so that is can receive the Service Display Name as a parameter, determine the Service Name then issue the start command. This seems simple enough but when looking at the FOR command and taking into account the unknown number of tokens possible when looking at the FOR option because some service display names have multiple space breaks.</p>
  
  <p>I'm looking for a solution that crosses multiple Window 2008/2003 systems without having to code for each specific set of services on that server or building a script that searcher all services when just one is stopper because there are services that are stopped for a reason and should not be restarted. This is why we have a central monitoring system that is using the display name/server name.</p>
  
  <p>Thank you,</p>