Advertisement
Bluestrings

Tablet Input Service Restart Batch File

Mar 11th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. @echo OFF
  2. color 1F
  3. title Tablet Service Restart
  4.  
  5.  
  6. :: BatchGotAdmin
  7. :-------------------------------------
  8. REM --> Check for permissions
  9. >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
  10.  
  11. REM --> If error flag set, we do not have admin.
  12. if '%errorlevel%' NEQ '0' (
  13. echo Requesting administrative privileges...
  14. goto UACPrompt
  15. ) else ( goto gotAdmin )
  16.  
  17. :UACPrompt
  18. echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
  19. set params = %*:"="
  20. echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
  21.  
  22. "%temp%\getadmin.vbs"
  23. del "%temp%\getadmin.vbs"
  24. exit /B
  25.  
  26. :gotAdmin
  27. pushd "%CD%"
  28. CD /D "%~dp0"
  29. :--------------------------------------
  30.  
  31. echo This will restart the TabletInputService in order to make your
  32. echo tablet work.
  33. echo -------------------------------------------------------------------
  34. echo Step 1
  35. echo -------------------------------------------------------------------
  36. echo Stopping Tablet Services...
  37. echo.
  38. net stop TabletInputService
  39.  
  40. echo.
  41. echo.
  42. echo -------------------------------------------------------------------
  43. echo Step 2
  44. echo -------------------------------------------------------------------
  45. echo Stopping Tablet Services...
  46. echo.
  47. net start TabletInputService
  48. echo.
  49. echo.
  50. echo -------------------------------------------------------------------
  51. echo Tasks completed. Tablet Input Service has been restarted.
  52. echo -------------------------------------------------------------------
  53. echo This window will close when you press a key.
  54. echo.
  55. echo.
  56. pause
  57.  
  58. REM
  59. REM
  60. REM
  61. REM
  62. REM
  63. REM
  64. REM
  65. REM
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement