每次更改需重启后才能生效
需要管理员权限
关闭键盘
sc config i8042prt start= disabled
开启键盘
sc config i8042prt start= auto
封装成cmd脚本
@echo off
sc query i8042prt|find /c "STOPPED"
if ERRORLEVEL 1 (
sc config i8042prt start= disabled
echo 键盘已关闭
) ELSE (
sc config i8042prt start= auto
echo 键盘已开启
)
echo 重启后生效
pause
支持情况
目前在Windows 10 1803上可用,可能会因为设备系统差异而造成不可用