Local $HLMPolicy = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Driver Signing","Policy")
Local $HLMNPolicy = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Non-Driver Signing","Policy")
Local $HCUPolicy = RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Driver Signing","Policy")
Local $HCUBOFV = RegRead("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows NT\Driver Signing","BehaviorOnFailedVerify")
Local $c=MsgBox(3,"Driver Signing","(HLM) Driver Signing: " & $HLMPolicy & @LF & "(HLM) Non-Driver Signing: " & $HLMNPolicy & @LF & "(HCU) Driver Signing: " & $HCUPolicy & @LF & "BehaviorOnFailedVerify: "& $HCUBOFV)
If $c = 6 Then
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Driver Signing","Policy","REG_BINARY",Binary('0x' & '00'))
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Non-Driver Signing","Policy","REG_BINARY",Binary('0x' & '00'))
RegWrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Driver Signing","Policy","REG_DWORD","00000000")
RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows NT\Driver Signing","BehaviorOnFailedVerify","REG_DWORD","00000000")
ElseIf $c = 7 Then
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Driver Signing","Policy")
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Non-Driver Signing","Policy")
RegDelete("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Driver Signing","Policy")
RegDelete("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows NT\Driver Signing","BehaviorOnFailedVerify")
EndIf
EXIT
[
Driver signing registry values cannot be modified directly in Windows
]
程式只能讀取作狀態判斷
雖然可以寫值進去,但還是無效
需從“我的電腦 →內容 → 硬體 → 驅動程式簽署 → 略過”進行手動更改才有效
自動模擬版(XP)
$title = "系統內容"
Run("control.exe sysdm.cpl")
WinWaitActive($title)
ControlCommand($title, "", "SysTabControl321", "TabRight", "")
ControlCommand($title, "", "SysTabControl321", "TabRight", "")
ControlClick($title, "驅動程式簽署(&S)", "Button4")
ControlClick("驅動程式碼簽署選項", "略過 - 直接安裝軟體,不需要我的同意(&I)","Button1")
ControlClick("驅動程式碼簽署選項", "確定","Button5")
ControlClick($title, "確定", "Button8")