0
我試圖做一個腳本來改變我在註冊表中的鼠標設置。當我運行腳本時,我發現已做出更改,但除非我註銷並重新登錄,否則這些更改不會生效,這是不可行的。如何在批處理腳本中更改鼠標設置?
:: MouseSensitivity 10
:: MouseSpeed (Set Pointer Precision) 0
:: MouseThreshold1 0
:: MouseThreshold2 0
@ECHO OFF
REG ADD "HKEY_CURRENT_USER\Control Panel\Mouse" /v MouseSensitivity /t REG_SZ /d 10 /f
REG ADD "HKEY_CURRENT_USER\Control Panel\Mouse" /v MouseSpeed /t REG_SZ /d 0 /f
REG ADD "HKEY_CURRENT_USER\Control Panel\Mouse" /v MouseThreshold1 /t REG_SZ /d 0 /f
REG ADD "HKEY_CURRENT_USER\Control Panel\Mouse" /v MouseThreshold2 /t REG_SZ /d 0 /f
ECHO Execution logged on: %DATE% at %TIME% >> test.txt
:: /* Tried this, doesn't work.
:: RUNDLL32.EXE USER32.DLL, UpdatePerUserSystemParameters
:: */
@EXIT /B 0
註冊表不是API。您需要從可以調用Win32 API的語言中調用SystemParametersInfo。 –