Custom Search

How to restart Terminal services from command line?

Since Terminal Services can’t be stopped there is no straightforward way we can do this. Microsoft says this is by design. But in some cases restarting termninal services could be possible by killing the svchost process that runs the terminal services.We can use tasklist and taskkill commands for this.

First get the process id of the terminal services process

 tasklist /svc | findstr /C:TermService

Check if Terminal sevices is the only service running in this svchost. If the svchost is shared with other services then you can stop reading further. Restarting terminal services is not possible on your machine.

On my machine I have got the following output.
C:\>tasklist /svc | findstr /C:TermService
svchost.exe                 1708 DcomLaunch, TermService
C:\>

As you can see DcomLaunch and TermService both share the same svchost process. In this case I can’t kill the process as it stops the other service also. (Note that DcomLaunch is an essential service on the system and killing it can even shutdown the system)


In the case of svchost not being shared with any other service you can go ahead and kill TermService process by the following command.


taskkill /F /PID  process_id 


0 comments:

You might also like: