Skip to content

Instantly share code, notes, and snippets.

@mvidaldp
Created January 10, 2021 19:03
Show Gist options
  • Save mvidaldp/630b5085e7ffcbdc5fedc49aa27dd2d7 to your computer and use it in GitHub Desktop.
Save mvidaldp/630b5085e7ffcbdc5fedc49aa27dd2d7 to your computer and use it in GitHub Desktop.
Disable/enable (toggle) touch screen on Windows using Batch
:: Make sure you run the script with admin rights or it won't work
devcon find *hid\vid* | findstr "touch screen" > device_id.txt
set /p device=<device_id.txt
set "touchscreenid=%device:~0,33%"
devcon status "%touchscreenid%" | findstr "running"
if %errorlevel% == 0 (
devcon disable "%touchscreenid%"
) else (
devcon enable "%touchscreenid%"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment