title: How to get process id by its service name with a script to variable
body: <p>I have service named <code>WinDefend</code> and it runs on process <code>svchost.exe</code><br>
  There other many <code>svchost.exe</code> processes and I need to find a way to get its ID.<br>
  when I run <code>tasklist /svc</code> I can see:
  <img src="https://i.stack.imgur.com/goNaA.png" alt="enter image description here"></p>
  
  <p>I am not sure how can I get it.<br>
  I found this command but when I tried the <code>select "PID"</code> it gave me empty column.
  <img src="https://i.stack.imgur.com/f48SZ.png" alt="enter image description here"></p>
  
  <p>I need to get the PID of the process to variable.</p>