Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

share|improve this answer
1  
Powershell is King! – MDT Guy May 14 '13 at 17:49

you can stop services via

net stop <servicename>

from a command prompt with admin rights

So in your case:

net stop TabletInputService

and to start the service run this:

net start TabletInputService
share|improve this answer
1  
Then of course Net Start to restart the service. – EBGreen May 14 '13 at 14:39
    
yeah, forgot to add this. – magicandre1981 May 14 '13 at 17:48

I use a toggle shortcut. Save this to a .bat file in a safe place. Make a shortcut to it. Open properties, press advanced, tick "Run as administrator". Them move the shortcut somewhere convenient like the start menu.

for /F "tokens=3 delims=: " %%H in ('sc query "TabletInputService" ^| findstr "        STATE"') do (
  if /I "%%H" NEQ "RUNNING" (
    echo "enabling,"
    sc config "TabletInputService" start= demand
    sc start "TabletInputService"
  ) ELSE (
    echo "disabling,"
    sc config "TabletInputService" start= disabled
    sc stop "TabletInputService"
  )
)

Its ugly though. If only we could control windows with javascript.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .