I found this script online and assume i just copy it into a textpad and make it a .vbs, but it doesnt seem to be working, am i missing something? it's used to turn off the power management feature in network cards.
Dim $objWMISvc, $objNicGUID, $strNicInstanceID, $strNicComponentID
$objWMISvc = GetObject("winmgmts:\\.\root\cimv2")
For Each $objNicGUID In $objWMISvc.ExecQuery("select * from Win32_NetworkAdapter where AdapterType=" + Chr(34) + "Ethernet 802.3" + Chr(34))
$strNicInstanceID = Right(("000" + $objNicGUID.DeviceID),4)
$strNicComponentID = ReadValue("HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\"+$strNicInstanceID,"ComponentId")
If Left($strNicComponentID,3) = "pci"
$=WriteValue("HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\"+$strNicInstanceID,"PnPCapabilities","00000038","REG_DWORD")
EndIf
Next
Question
Got3n
I found this script online and assume i just copy it into a textpad and make it a .vbs, but it doesnt seem to be working, am i missing something? it's used to turn off the power management feature in network cards.
Dim $objWMISvc, $objNicGUID, $strNicInstanceID, $strNicComponentID $objWMISvc = GetObject("winmgmts:\\.\root\cimv2") For Each $objNicGUID In $objWMISvc.ExecQuery("select * from Win32_NetworkAdapter where AdapterType=" + Chr(34) + "Ethernet 802.3" + Chr(34)) $strNicInstanceID = Right(("000" + $objNicGUID.DeviceID),4) $strNicComponentID = ReadValue("HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\"+$strNicInstanceID,"ComponentId") If Left($strNicComponentID,3) = "pci" $=WriteValue("HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\"+$strNicInstanceID,"PnPCapabilities","00000038","REG_DWORD") EndIf NextLink to comment
Share on other sites
4 answers to this question
Recommended Posts