Windows 8 stop or start services from the command line

command lineserviceswindows 8

I have a touch screen Windows 8 laptop, which has a touch screen keyboard that constantly shows up when I am working in metro apps. Is there a way to stop a service (specifically "Touch screen keyboard and handwriting panel" service) from the command line?

I know I can permanently stop the service from the service manager, but I am hoping to find a solution wherein I can create a shortcut to disable it, and another to re-enable it if needed.

Best Answer

Using PowerShell you can run the command Stop-Service or Start-Service. If you wanted to toggle between the two...

$service = Get-Service TabletInputService
if($service.status -eq "Running") {Stop-Service $service} else {Start-Service $service}

Drop that in PowerShell ISE and save it as a .ps1 and you should have a quick shortcut to alternate the service's state. I don't remember if writing your own script requires you to monkey with Set-ExecutionPolicy, but you may have to loosen some restrictions to get the .ps1 to run without griping.