不必更新驱动,直接重命名就可以。
#include <SetupAPI.au3>
$fStatus = _RenameDeviceByDisplayName("ACPI Multiprocessor PC", "standardPC")
If ($fStatus) Then
MsgBox(48, "OK", "Done.")
Else
MsgBox(48, "Error", "Failed.")
EndIf
Func _RenameDeviceByDisplayName($sDisplayName, $sNewName)
Local $sDeviceId, $hDevs, $tDevInfo, $fStatus
$sDeviceID = _CM_Get_Device_ID_By_Name_Ex($sDisplayName)
If ($sDeviceID = "") Then Return 0
If Not _SetupDiCreateDeviceDevs($sDeviceID, $hDevs, $tDevInfo) Then
Return 0
EndIf
$fStatus = _SetupDiSetDeviceRegistryProperty( _
$hDevs, $tDevInfo, $CM_DRP_FRIENDLYNAME - 1, _
$sNewName, StringLen($sNewName) * 2, "str")
_SetupDiDestroyDeviceInfoList($hDevs)
Return $fStatus
EndFunc ;==>_RenameDeviceByDisplayName
|