Just replace the TermService and ‘Remote Desktop Services’ with the service name you wish to force kill and restart it.
[shell]
FOR /F “tokens=3” %%A IN (‘sc queryex TermService ^| findstr PID’) DO (SET pid=%%A)
taskkill /F /PID %pid%
sleep 10
powershell -Command “& {Start-Service -displayname ‘Remote Desktop Services’}”
[/shell]