0

I am trying to terminate a service using PID/Servicename which is already in running state in the Windows services list.

I have tried "Process" Library and it works if I start a process from Robot Framework and terminate it using handle from there itself. But, not for the existing process in the Windows services.

A. Kootstra
  • 6,827
  • 3
  • 20
  • 43

1 Answers1

0

you could try something like this:

${rc_code}    ${output}    Run And Return Rc And Output    taskkill /PID ${PID} /F /T
Run Keyword If    '${rc_code}' != '0'    Log    There was error during termination of process    WARN
JaPyR
  • 1,367
  • 7
  • 14
  • It worked well, I also achieved it by calling a batch file with net start and stop command. However, your answer made the job much simpler. Is there a windows command to start a service as well? – Senthil Shiv Aug 21 '18 at 10:52
  • `sc` - [https://stackoverflow.com/a/133926/3446126](https://stackoverflow.com/a/133926/3446126) - a google away :) – Todor Minakov Aug 23 '18 at 08:44