Changing NIC speed and duplex option

  • Thread starter Thread starter Tom Ker
  • Start date Start date
T

Tom Ker

We've got a project about to start to change all our PCs from 10/Full to
Auto. Thankfully we only have 3 or 4 different NICs in our environment, but
we have 1,000s of them so I want to write a script that will do the change
for me.

Can someone point me to some code to get me started with this. please?

Thanks,

Tom
 
Tom Ker said:
We've got a project about to start to change all our PCs from 10/Full to
Auto. Thankfully we only have 3 or 4 different NICs in our environment,
but we have 1,000s of them so I want to write a script that will do the
change for me.

Can someone point me to some code to get me started with this. please?

Thanks,

Tom

Tom,

I use the following script to set our NIC's to 100/FULL, I'm sure it can
be adapted to set yours to Auto.

The script scans the registry to obtain each NIC that is installed. For each
NIC that is found, the script will locate and apply the appropriate registry
value you define in a separate .ini file (SpdDplx.ini). The .ini file
contains the registry value for each NIC based on the vendor ID and device
ID as found in the ComponentID registry value for a given NIC. Here is my
example, keep in mind that the values listed in the .ini file are for
setting the NIC's to 100/FULL, you will need to add/edit your entries for
the NIC's in your environment to the values that will set the NIC's to
Auto.

SpdDplx.ini
========
[14E41645]
;Broadcom NetXtreme Gigabit Ethernet (BCM5701)
;ComponentId=PCI\VEN_14E4&DEV_1645
RequestedMediaType=6

[14E41659]
;Broadcom NetXtreme Gigabit Ethernet PCI Express (BCM5750A1)
;ComponentId=PCI\VEN_14E4&DEV_1659
RequestedMediaType=6

[14E416A6]
;Broadcom NetXtreme Gigabit Ethernet (BCM5702X)
;ComponentId=PCI\VEN_14E4&DEV_16A6
RequestedMediaType=6

[14E41644]
;Broadcom NetXtreme Gigabit Ethernet (BCM5700/5401)
;ComponentId=PCI\VEN_14E4&DEV_1644
RequestedMediaType=6

[14E41648]
;Broadcom NetXtreme Gigabit Ethernet (BCM5704)
;ComponentId=PCI\VEN_14E4&DEV_1648
RequestedMediaType=6

[14E416A7]
;Broadcom NetXtreme Gigabit Ethernet
;ComponentId=PCI\VEN_14E4&DEV_16A7
RequestedMediaType=6

[14E416C7]
;Broadcom NetXtreme Gigabit Ethernet
;ComponentId=PCI\VEN_14E4&DEV_16C7
RequestedMediaType=6

[14E416A8]
;Broadcom NetXtreme Gigabit Ethernet (BCM5704S)
;ComponentId=PCI\VEN_14E4&DEV_16A8
RequestedMediaType=6

[10B79805]
;3Com EtherLink Server 10/100 PCI (3C980C-TXM)
;ComponentId=PCI\VEN_10b7&DEV_9805
Duplexmode=FullDuplex
media=100FULL

[10B79800]
;3Com EtherLink Server 10/100 PCI (3C980B-TX)
;ComponentId=PCI\VEN_10b7&DEV_9800
Duplexmode=FullDuplex
media=100FULL

[10EC8139]
;Realtek RTL8139 Family PCI Fast Ethernet NIC
;ComponentId=PCI\VEN_10EC&DEV_8139
DuplexMode=5

[80861004]
;Intel PRO/1000 Gigabit Desktop Adapter
;ComponentId=PCI\VEN_8086&DEV_1004
SpeedDuplex=5

[80861008]
;Intel PRO/1000 Gigabit Desktop Adapter
;ComponentId=PCI\VEN_8086&DEV_1008
SpeedDuplex=5

[80861009]
;Intel PRO/1000 Gigabit Desktop Adapter
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5

[8086100C]
;Intel PRO/1000 Gigabit Desktop Adapter
;ComponentId=PCI\VEN_8086&DEV_100C
SpeedDuplex=5

[8086100E]
;Intel PRO/1000 Gigabit Desktop Adapter
;ComponentId=PCI\VEN_8086&DEV_100E
SpeedDuplex=5

[80861010]
;Intel PRO/1000 Gigabit Desktop Adapter
;ComponentId=PCI\VEN_8086&DEV_1010
SpeedDuplex=5

[10222000]
;AMD PCNET Family Ethernet Adapter (PCI)
;ComponentId=PCI\VEN_1022&DEV_2000
EXTPHY=2

[11063106]
;VIA VT6105M Rhine III Management Adapter
;ComponentId=PCI\VEN_1106&DEV_3106
ConnectionType=2

[11063043]
;VIA VT86C100A Fast Ethernet Adapter
;ComponentId=PCI\VEN_1106&DEV_3043
ConnectionType=2

[11063065]
;VIA PCI 10/100Mb Fast Ethernet Adapter
;ComponentId=PCI\VEN_1106&DEV_3065
ConnectionType=2

[12829102]
;DAVICOM 9102-Based PCI Fast Ethernet Adapter
;ComponentId=PCI\VEN_1282&DEV_9102
ConnectionType=4

[10110009]
;DC21x4 Based Network Adapter Driver
;ComponentId=PCI\VEN_1011&DEV_0009
ConnectionType=9

[10B79200]
;3Com EtherLink XL 10/100 PCI For Complete PC Management
;ComponentId=PCI\VEN_10B7&DEV_9200
Media_type=100FULL



SetSpeed.vbs
==========
Const HKLM = &H80000002

strComputer = "."
Set fso = CreateObject("Scripting.FileSystemObject")
Set objRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
strComputer & "\root\default:StdRegProv")
sNetPath =
"System\Currentcontrolset\Control\Class\{4D36E972-E325-11CE-BFC1-08002be10318}"

SetSpeedDuplex()

Sub SetSpeedDuplex()
Dim section, strValue, subkey, arrSubKeys

objRegistry.EnumKey HKLM, sNetPath, arrSubKeys
For Each subkey In arrSubKeys
objRegistry.GetStringvalue HKLM, sNetPath & "\" & subkey, "ComponentId",
strValue
if not isnull(strValue) then
strValue = lcase(strValue)
section = left(replace(replace(strValue, "pci\ven_", ""), "&dev_",
""), 8)
ReadDuplexIni section, subkey
end if
Next
End Sub

Sub ReadDuplexIni(section, subkey)
Dim ini, line, file

file = "spddplx.ini"
If fso.FileExists(file) Then
Set ini = fso.OpenTextFile(file, 1, False)
Do While ini.AtEndOfStream = False
line = ini.ReadLine
If lcase(line) = "[" & lcase(section) & "]" Then
line = ini.ReadLine
Do While Left(line, 1) <> "["
If left(line, 1) <> ";" and len(line) > 0 Then
UpdateReg line, subkey
End If
If ini.AtEndOfStream Then Exit Do
line = ini.ReadLine
Loop
Exit Do
End If
Loop
ini.Close
End If
End Sub

Sub UpdateReg(line, subkey)
Dim lRC

key = split(line, "=")
lRC=objRegistry.SetStringValue(HKLM, sNetPath & "\" & subkey, key(0),
key(1))
End Sub



Hope this helps,

B-Mann
 
' VBS script that Echo's out ComponentID and driverDescriptions values
' you can use it on new computers to check if you need to update spddplx.ini
' And again thank you B-Mann

Const HKLM = &H80000002
strComputer = "."
Set fso = CreateObject("Scripting.FileSystemObject")
Set objRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
sNetPath = "System\Currentcontrolset\Control\Class\{4D36E972-E325-11CE-BFC1-08002be10318}"

SetSpeedDuplex()

' ----------------------------------------------------------------------------
Sub SetSpeedDuplex()
Dim section, strValue, subkey, arrSubKeys

' DriverDesc Values in registry that will not be listed.
NOTvalues = "RAS Async Adapter, WAN Miniport, Direct Parallel, Packet Scheduler"

strDescriptions = "DriverDescription : ComponentID to search spddplx.ini " & vbCrLf

objRegistry.EnumKey HKLM, sNetPath, arrSubKeys
For Each subkey In arrSubKeys
objRegistry.GetStringvalue HKLM, sNetPath & "\" & subkey, "ComponentId",strValue
objRegistry.GetStringvalue HKLM, sNetPath & "\" & subkey, "DriverDesc",strDriverDesc
if not isnull(strValue) then
strValue = lcase(strValue)
section = left(replace(replace(strValue, "pci\ven_", ""), "&dev_",""), 8)
strDriverDescTest = left(strDriverDesc,9)
'Check the driverDesc registry value against NOTvalues.
intMatch = InStr(NOTvalues, strDriverDescTest)
IF intMatch = 0 then
strDescriptions = strDescriptions & strDriverDesc & " : " & section & vbCrLf
End if
end if
Next
wscript.echo strDescriptions
End Sub
 
Help!

I have been tasked with the same request. Change all known NIC's to auto. I have followed this post and am hopeful on a solution. I have added one line to the SpdDplx.ini file:

[14E4167D]

;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)

;ComponentId=pci\ven_14e4&dev_167d&subsys_0944103c

RequestedMediaType=5

[14E41645]

;Broadcom NetXtreme Gigabit Ethernet (BCM5701)

;ComponentId=PCI\VEN_14E4&DEV_1645

RequestedMediaType=5

[14E41659]

;Broadcom NetXtreme Gigabit Ethernet PCI Express (BCM5750A1)

;ComponentId=PCI\VEN_14E4&DEV_1659

RequestedMediaType=5

[14E416A6]

;Broadcom NetXtreme Gigabit Ethernet (BCM5702X)

;ComponentId=PCI\VEN_14E4&DEV_16A6

RequestedMediaType=5

[14E41644]

;Broadcom NetXtreme Gigabit Ethernet (BCM5700/5401)

;ComponentId=PCI\VEN_14E4&DEV_1644

RequestedMediaType=5

[14E41648]

;Broadcom NetXtreme Gigabit Ethernet (BCM5704)

;ComponentId=PCI\VEN_14E4&DEV_1648

RequestedMediaType=5

[14E416A7]

;Broadcom NetXtreme Gigabit Ethernet

;ComponentId=PCI\VEN_14E4&DEV_16A7

RequestedMediaType=5

[14E416C7]

;Broadcom NetXtreme Gigabit Ethernet

;ComponentId=PCI\VEN_14E4&DEV_16C7

RequestedMediaType=5

[14E416A8]

;Broadcom NetXtreme Gigabit Ethernet (BCM5704S)

;ComponentId=PCI\VEN_14E4&DEV_16A8

RequestedMediaType=5

[10B79805]

;3Com EtherLink Server 10/100 PCI (3C980C-TXM)

;ComponentId=PCI\VEN_10b7&DEV_9805

Duplexmode=FullDuplex

media=100FULL

[10B79800]

;3Com EtherLink Server 10/100 PCI (3C980B-TX)

;ComponentId=PCI\VEN_10b7&DEV_9800

Duplexmode=FullDuplex

media=100FULL

[10EC8139]

;Realtek RTL8139 Family PCI Fast Ethernet NIC

;ComponentId=PCI\VEN_10EC&DEV_8139

DuplexMode=5

[80861004]

;Intel PRO/1000 Gigabit Desktop Adapter

;ComponentId=PCI\VEN_8086&DEV_1004

SpeedDuplex=5

[80861008]

;Intel PRO/1000 Gigabit Desktop Adapter

;ComponentId=PCI\VEN_8086&DEV_1008

SpeedDuplex=5

[80861009]

;Intel PRO/1000 Gigabit Desktop Adapter

;ComponentId=PCI\VEN_8086&DEV_1009

SpeedDuplex=5

[8086100C]

;Intel PRO/1000 Gigabit Desktop Adapter

;ComponentId=PCI\VEN_8086&DEV_100C

SpeedDuplex=5

[8086100E]

;Intel PRO/1000 Gigabit Desktop Adapter

;ComponentId=PCI\VEN_8086&DEV_100E

SpeedDuplex=5

[80861010]

;Intel PRO/1000 Gigabit Desktop Adapter

;ComponentId=PCI\VEN_8086&DEV_1010

SpeedDuplex=5

[10222000]

;AMD PCNET Family Ethernet Adapter (PCI)

;ComponentId=PCI\VEN_1022&DEV_2000

EXTPHY=2

[11063043]

;VIA VT86C100A Fast Ethernet Adapter

;ComponentId=PCI\VEN_1106&DEV_3043

ConnectionType=2

[11063065]

;VIA PCI 10/100Mb Fast Ethernet Adapter

;ComponentId=PCI\VEN_1106&DEV_3065

ConnectionType=2

[12829102]

;DAVICOM 9102-Based PCI Fast Ethernet Adapter

;ComponentId=PCI\VEN_1282&DEV_9102

ConnectionType=4

[10110009]

;DC21x4 Based Network Adapter Driver

;ComponentId=PCI\VEN_1011&DEV_0009

ConnectionType=9

[10B79200]

;3Com EtherLink XL 10/100 PCI For Complete PC Management

;ComponentId=PCI\VEN_10B7&DEV_9200

Media_type=100FULL



When I run the vbscript, I receive the following error:

Microsoft VBScript runtime error: Subscript out of range: '[number: 1]'

Line (87, 1)

The full script is as follows:

Const HKLM = &H80000002

strComputer = "."

Set fso = CreateObject("Scripting.FileSystemObject")

Set objRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")

sNetPath = "System\Currentcontrolset\Control\Class\{4D36E972-E325-11CE-BFC1-08002be10318}"

SetSpeedDuplex()

Sub SetSpeedDuplex()

Dim section, strValue, subkey, arrSubKeys

objRegistry.EnumKey HKLM, sNetPath, arrSubKeys

For Each subkey In arrSubKeys

objRegistry.GetStringvalue HKLM, sNetPath & "\" & subkey, "ComponentId", strValue

if not isnull(strValue) then

strValue = lcase(strValue)

section = left(replace(replace(strValue, "pci\ven_", ""), "&dev_", ""), 8)

ReadDuplexIni section, subkey

end if

Next

End Sub

Sub ReadDuplexIni(section, subkey)

Dim ini, line, file

file = "SpdDplx.ini"

If fso.FileExists(file) Then

Set ini = fso.OpenTextFile(file, 1, False)

Do While ini.AtEndOfStream = False

line = ini.ReadLine

If lcase(line) = "[" & lcase(section) & "]" Then

line = ini.ReadLine

Do While Left(line, 1) <> "["

If left(line, 1) <> ";" and len(line) > 0 Then

UpdateReg line, subkey

End If

If ini.AtEndOfStream Then Exit Do

line = ini.ReadLine

Loop

Exit Do

End If

Loop

ini.Close

End If

End Sub

Sub UpdateReg(line, subkey)

Dim lRC

key = split(line, "=")

lRC=objRegistry.SetStringValue(HKLM, sNetPath & "\" & subkey, key(0), key(1))

End Sub


Any help would be GREATLY appreciated.
 
Thanks for getting back to me......

In the registry, I have:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009]
"TxPacketDescCnt"="200"
"RxStdDescCnt"="200"
"RxCoalescingTicks"="10"
"TxCoalescingTicks"="30"
"RxMaxCoalescedFrames"="5"
"TxMaxCoalescedFrames"="200"
"ClockControl"="1"
"Characteristics"=dword:00000084
"BusType"="5"
"ComponentId"="pci\\ven_14e4&dev_167d&subsys_0944103c"
"Enable8021p"="0"
"FlowControlCap"="2147483648"
"LargeSendOffload"="1"
"RequestedMediaType"="6"
"TaskOffloadCap"="63"
"WakeUpModeCap"="3"
"WireSpeed"="1"
"WolSpeed"="0"
"InfPath"="oem0.inf"
"InfSection"="BCM5750A1M.XpInst"
"InfSectionExt"=".NTx86"
"ProviderName"="Broadcom"
"DriverDateData"=hex:00,00,22,37,6f,cb,c4,01
"DriverDate"="11-16-2004"
"DriverVersion"="7.80.1.0"
"MatchingDeviceId"="pci\\ven_14e4&dev_167d&subsys_0944103c"
"DriverDesc"="Broadcom NetXtreme Gigabit Ethernet"
"NetCfgInstanceId"="{76AD0FF9-2F10-48D5-9EB9-86BF0C544F32}"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Linkage]
"RootDevice"=hex(7):7b,00,37,00,36,00,41,00,44,00,30,00,46,00,46,00,39,00,2d,\
00,32,00,46,00,31,00,30,00,2d,00,34,00,38,00,44,00,35,00,2d,00,39,00,45,00,\
42,00,39,00,2d,00,38,00,36,00,42,00,46,00,30,00,43,00,35,00,34,00,34,00,46,\
00,33,00,32,00,7d,00,00,00,00,00
"UpperBind"=hex(7):44,00,4e,00,45,00,00,00,00,00
"Export"=hex(7):5c,00,44,00,65,00,76,00,69,00,63,00,65,00,5c,00,7b,00,37,00,36,\
00,41,00,44,00,30,00,46,00,46,00,39,00,2d,00,32,00,46,00,31,00,30,00,2d,00,\
34,00,38,00,44,00,35,00,2d,00,39,00,45,00,42,00,39,00,2d,00,38,00,36,00,42,\
00,46,00,30,00,43,00,35,00,34,00,34,00,46,00,33,00,32,00,7d,00,00,00,00,00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi]
"Service"="b57w2k"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Interfaces]
"UpperRange"="ndis5"
"LowerRange"="ethernet"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params]
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\Enable8021p]
"ParamDesc"="802.1p QOS"
"default"="0"
"type"="enum"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\Enable8021p\enum]
"0"="Disable"
"1"="Enable"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\FlowControlCap]
"ParamDesc"="Flow Control"
"default"="2147483648"
"type"="enum"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\FlowControlCap\enum]
"0"="Disable"
"1"="Rx PAUSE"
"2"="Tx PAUSE"
"3"="Rx/Tx PAUSE"
"2147483648"="Auto"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\LargeSendOffload]
"ParamDesc"="Large Send Offload"
"default"="1"
"type"="enum"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\LargeSendOffload\enum]
"0"="Disable"
"1"="Enable"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\NetworkAddress]
"ParamDesc"="Locally Administered Address"
"Default"=""
"type"="edit"
"LimitText"="12"
"UpperCase"="1"
"optional"="1"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\RequestedMediaType]
"ParamDesc"="Speed & Duplex"
"default"="0"
"type"="enum"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\RequestedMediaType\enum]
"0"="Auto"
"3"="10 Mb Half"
"4"="10 Mb Full"
"5"="100 Mb Half"
"6"="100 Mb Full"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\TaskOffloadCap]
"ParamDesc"="Checksum Offload"
"default"="63"
"type"="enum"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\TaskOffloadCap\enum]
"0"="None"
"42"="Rx TCP/IP Checksum"
"21"="Tx TCP/IP Checksum"
"63"="Tx/Rx TCP/IP Checksum"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\WakeUpModeCap]
"ParamDesc"="Wake Up Capabilities"
"default"="3"
"type"="enum"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\WakeUpModeCap\enum]
"0"="None"
"1"="Magic Packet"
"2"="Wake Up Frame"
"3"="Both"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\WireSpeed]
"ParamDesc"="(e-mail address removed)"
"default"="1"
"type"="enum"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\WireSpeed\enum]
"0"="Disable"
"1"="Enable"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\WolSpeed]
"ParamDesc"="WOL Speed"
"default"="0"
"type"="enum"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0009\Ndi\Params\WolSpeed\enum]
"0"="Auto"
"1"="10 Mb"
"2"="100 Mb"

Basedd on this information, is the line in the ini right? Do I need to remove the ";"?

Do we know who B-Mann is? :)
 
Try to edit your ini file. Delete the last blank line and create new one. (due to end of file information)

Do NOT delete the ;

lines in .ini file starting with ; are ignored... in the script.
Its only NIC information.
 
Last edited:
(e-mail address removed)

I have a very simple solution which implies to know its environment well. Th
is example modifies in Auto (strValue = 0) for Intel Nic(SpeedDuplex) and Br
oadcom NIC (RequestedMediaType).
Can be used with computer GPO.

Const HKEY_LOCAL_MACHINE = &H80000002

strComputer = "."

Set oReg=GetObject(" winmgmts:{impersonationLevel=impersonate
}!\\" & _
strComputer & "\root\default:StdRegProv")

strKeyPath = " System\Currentcontrolset\Control\Class\{
4D36E972-E325-11CE-BFC
1-08002be10318}"

oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys

For Each subkey In arrSubKeys

' Cartes Intel - SpeedDuplex
oReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey, "Spee
dDuplex", strValue
If strValue <> 0 Then
strValue = 0
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath & "\" & subkey, "Spee
dDuplex", strValue

End If

' Cartes Broadcom - RequestedMediaType
oReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey, "Reque
stedMediaType", strValue
If strValue <> 0 Then
strValue = 0
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath & "\" & subkey, "Requ
estedMediaType", strValue

End If

Next
 
simple way to change NIC Speed

(e-mail address removed)

I have a very simple solution which implies to know its environment well. Th
is example modifies in Auto (strValue = 0) for Intel Nic(SpeedDuplex) and Br
oadcom NIC (RequestedMediaType).
Can be used with computer GPO.

Const HKEY_LOCAL_MACHINE = &H80000002

strComputer = "."

Set oReg=GetObject(" winmgmts:{impersonationLevel=impersonate
}!\\" & _
strComputer & "\root\default:StdRegProv")

strKeyPath = " System\Currentcontrolset\Control\Class\{
4D36E972-E325-11CE-BFC
1-08002be10318}"

oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys

For Each subkey In arrSubKeys

' Cartes Intel - SpeedDuplex
oReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey, "Spee
dDuplex", strValue
If strValue <> 0 Then
strValue = 0
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath & "\" & subkey, "Spee
dDuplex", strValue

End If

' Cartes Broadcom - RequestedMediaType
oReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey, "Reque
stedMediaType", strValue
If strValue <> 0 Then
strValue = 0
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath & "\" & subkey, "Requ
estedMediaType", strValue

End If

Next
 
...
We had a problem with Broadcom and Intel networkcards when we connected the nics via a Netgear switch to our core switches.

When the Intel Nic portspeed was set to 100FULL DUPLEX the Netgear switched to half duplex and alot of collisions, crc's occured.
But the Broadcoms had another problem, the portspeed of the Netgear switches didn't go 100FDX but half, so needed to set these to 100FDX.

I made a script with a ini settings file, and gave it to a college for testing.
But some days later he gave me a reply that I got the script from this forum... So I looked it up and strangely it is almost the same... scary

I removed some comments because the were in Dutch language, but really wanted to share this information/ script...

net_sds.vbs
Code:
[font=Courier New]Option Explicit
' ================================================================================================================
' NET_SDS: Network SpeedDuplex Settings[/font]
[font=Courier New]' Auteur: Dennis van Velzen
' Datum: 06-12-2007
' Update op dit script naar aanleiding van Problem #535
' Geschreven in Notepad ++ (VB / ANSI)
' Versie: V1.00[/font]
[font=Courier New]' ================================================================================================================[/font]
[font=Courier New]'DEBUG MODE
Const Debugmode = 1 
Const HKLM = &H80000002[/font]
[font=Courier New]Dim WshShell, WshNetwork, WshFSO, WshUsrEnv, strComputer, objItem, inputFile, sNetPath
Dim objWMIService, objWMIRegistry, colItems[/font]
[font=Courier New]CreerObjecten()[/font]
[font=Courier New]'DEBUG MODE
If Debugmode = 1 Then
Debugmode_ShowNetworkadapters()
Debugmode_BestaatSettingFile()
End If[/font]
[font=Courier New]Set_SpeedDuplex()
RuimOp()[/font]
[font=Courier New]Sub Debugmode_BestaatSettingFile
If BestaatSettingsFile = True Then 
Wscript.Echo "Settings bestand (" & inputFile & ") is gevonden."
Else
Wscript.Echo "Settings bestand (" & inputFile & ") is NIET gevonden."
End If
End Sub[/font]
[font=Courier New]Sub Debugmode_ShowNetworkadapters
For Each objItem in colItems
Wscript.Echo "Apparaat nr. " & objItem.DeviceID & vbCrLf & _
"Omschrijving: " & objItem.Description & vbCrLf & _
"Hardware adres: " & objItem.MACAddress & vbCrLf & _
"PNPDeviceID: " & objItem.PNPDeviceID & vbCrLf & vbCrLf & _
"Bovenstaande omschrijving en PNPDeviceID worden gebruikt in het" & vbCrLf & _
"settings bestand. Echter heeft dit systeem genoeg aan " & _
formatRegistryKey(objItem.PNPDeviceID) & "."
Next
End Sub[/font]
[font=Courier New]Sub Set_SpeedDuplex()
Dim sectie, strWaarde, subsleutel, arrSubsleutels[/font]
[font=Courier New]objWMIRegistry.EnumKey HKLM, sNetPath, arrSubsleutels
For Each subsleutel In arrSubsleutels
objWMIRegistry.GetStringvalue HKLM, sNetPath & "\" & subsleutel, "ComponentId", strWaarde
If not isnull(strWaarde) then
sectie = formatRegistryKey(strWaarde)
LeesSettingsBestand sectie, subsleutel
End if
Next
End Sub[/font]
[font=Courier New]Sub LeesSettingsBestand(sectie, subsleutel)
Dim ini, lijn, file[/font]
[font=Courier New]file = inputFile
If BestaatSettingsFile = True Then
Set ini = wshFSO.OpenTextFile(file, 1, False)
Do While ini.AtEndOfStream = False
lijn = ini.ReadLine
If lcase(lijn) = "[" & lcase(sectie) & "]" Then
lijn = ini.ReadLine
Do While Left(lijn, 1) <> "["
If left(lijn, 1) <> ";" and len(lijn) > 0 Then
WijzigRegister lijn, subsleutel
End If
If ini.AtEndOfStream Then Exit Do
lijn = ini.ReadLine
Loop
Exit Do
End If
Loop
ini.Close
Else
End If 
End Sub[/font]
[font=Courier New]Sub WijzigRegister(lijn, subsleutel)
Dim lRC, sleutel[/font]
[font=Courier New]sleutel = split(lijn, "=")
lRC=objWMIRegistry.SetStringValue(HKLM, sNetPath & "\" & subsleutel, sleutel(0), sleutel(1))
End Sub[/font]
[font=Courier New]Function BestaatSettingsFile
BestaatSettingsFile = False
On Error Resume Next[/font]
[font=Courier New]If WshFSO.FileExists(inputFile) Then 
BestaatSettingsFile = True
End If
End Function[/font]
[font=Courier New]Function formatRegistryKey(strWaarde)
formatRegistryKey = ""
On Error resume next
strWaarde = lcase(strWaarde)
strWaarde = replace(strWaarde, "pci\ven_", "")
strWaarde = replace(strWaarde, "&dev_","")
strWaarde = left(strWaarde, 8)
formatRegistryKey = strWaarde
End Function[/font]
[font=Courier New]Sub CreerObjecten()[/font]
[font=Courier New]' Instellingen
inputFile = "settings.ini"[/font]
[font=Courier New]' Deze computer
strComputer = "."
 
' Locatie van netwerk hardware in het register
sNetPath = "System\Currentcontrolset\Control\Class\{4D36E972-E325-11CE-BFC1-08002be10318}"[/font]
[font=Courier New]' Maak WMI objecten aan
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objWMIRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")[/font]
[font=Courier New]' Query WMI win32 netwerkadapters
Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter",,48)[/font]
[font=Courier New]Set WshShell = WScript.CreateObject("Wscript.Shell")
Set WshNetwork = WScript.CreateObject("Wscript.Network")
Set WshFSO = Wscript.CreateObject("Scripting.FileSystemObject")
Set WshUsrEnv = WshShell.Environment("USER")
End Sub[/font]
[font=Courier New]Sub RuimOp()[/font]
[font=Courier New]Set objItem = Nothing[/font]
[font=Courier New]Set objWMIService = Nothing
Set colItems = Nothing[/font]
[font=Courier New]Set WshFSO = Nothing
Set WshNetwork = Nothing
Set WshShell = Nothing 
Set WshUsrEnv = Nothing
 
End Sub[/font]

settings.ini
Code:
[font=Courier New][14E41677]
;Broadcom NetXtreme Gigabit Ethernet (HP dc7100SFF)
;ComponentId=PCI\VEN_14E4&DEV_1677
RequestedMediaType=6
SpeedDuplex=4[/font]
[font=Courier New][14E41600]
;Broadcom NetXtreme Gigabit Ethernet (HP dc7600SFF)
;ComponentId=PCI\VEN_14E4&DEV_1600
RequestedMediaType=6
SpeedDuplex=4[/font]
[font=Courier New][8086104A]
;Intel(r) 82566DM Gigabit Network Connection (HP dc7700SFF)
;ComponentId=PCI\VEN_8086&DEV_104A
RequestedMediaType=6
SpeedDuplex=0[/font]

Have fun with it... :D Regards, Dennis
 
help

can some one help, I don't have a clue what i'm doing i need to change the dulplex to auto on HP 7100 7600 7700 please help.
 
newbie007 said:
can some one help, I don't have a clue what i'm doing i need to change the dulplex to auto on HP 7100 7600 7700 please help.

Can u tell us more, please...

How much machines does this apply?

You can use my or one of the scripts above.

Change all "SpeedDuplex" properties to "0"
"0" = AUTO

[14E41677]
;Broadcom NetXtreme Gigabit Ethernet (HP dc7100SFF)
;ComponentId=PCI\VEN_14E4&DEV_1677
RequestedMediaType=6
SpeedDuplex=0
[14E41600]
;Broadcom NetXtreme Gigabit Ethernet (HP dc7600SFF)
;ComponentId=PCI\VEN_14E4&DEV_1600
RequestedMediaType=6
SpeedDuplex=0
[8086104A]
;Intel(r) 82566DM Gigabit Network Connection (HP dc7700SFF)
;ComponentId=PCI\VEN_8086&DEV_104A
RequestedMediaType=6
SpeedDuplex=0
 
almost done

3,450 this will go throu the logon script that i have to put together : (

Yes but a bunch of boxes open up and ask to hit ok. I would like it to load then reboot the desktop all windows xp desktops

what is this and how did you look it up [14E41677]
;Broadcom NetXtreme Gigabit Ethernet (HP dc7100SFF)
;ComponentId=PCI\VEN_14E4&DEV_1677 RequestedMediaType=6
SpeedDuplex=0 if i have a different nic card how would i be able to add this . o far you have help me so much i thank you in advance your the best.


ddvelzen said:
Can u tell us more, please...

How much machines does this apply? 3,450 this will go throu the logon script that i have to put together : (

You can use my or one of the scripts above. Yes but a bunch of boxes open up and ask to hit ok. I would like it to load then reboot the desktop all windows xp desktops what is this [14E41677]
;Broadcom NetXtreme Gigabit Ethernet (HP dc7100SFF)
;ComponentId=PCI\VEN_14E4&DEV_1677 RequestedMediaType=6
SpeedDuplex=0 if i have a different nic card how would i be able to add this . o far you have help me so much i thank you in advance your the best.

[14E41677]
;Broadcom NetXtreme Gigabit Ethernet (HP dc7100SFF)
;ComponentId=PCI\VEN_14E4&DEV_1677
RequestedMediaType=6
SpeedDuplex=0v
Change all "SpeedDuplex" properties to "0"
"0" = AUTO

[14E41677]
;Broadcom NetXtreme Gigabit Ethernet (HP dc7100SFF)
;ComponentId=PCI\VEN_14E4&DEV_1677
RequestedMediaType=6
SpeedDuplex=0
[14E41600]
;Broadcom NetXtreme Gigabit Ethernet (HP dc7600SFF)
;ComponentId=PCI\VEN_14E4&DEV_1600
RequestedMediaType=6
SpeedDuplex=0
[8086104A]
;Intel(r) 82566DM Gigabit Network Connection (HP dc7700SFF)
;ComponentId=PCI\VEN_8086&DEV_104A
RequestedMediaType=6
SpeedDuplex=0
 
Great Script!

Thanks to everyone who has contributed to this thread, it's been a great help to me.

I've expanded the in-scope NICs to include every entry I can find for Broadcom and Intel as of May 2008. Included below. I'm afraid that I haven't been particularly thorough with the comment fields, so often the vendor ID and card name are not updated, but the [xxxxxxx] entries are correct AFAIK.

JQ
====

[14E4169C]
;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_167d&subsys_0944103c
RequestedMediaType=6
[14E4166E]
;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_167d&subsys_0944103c
RequestedMediaType=6
[014E4170D]
;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_167d&subsys_0944103c
RequestedMediaType=6
[14E4170E]
;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_167d&subsys_0944103c
RequestedMediaType=6
[14E4165E]
;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_167d&subsys_0944103c
RequestedMediaType=6
[14E41654]
;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_167d&subsys_0944103c
RequestedMediaType=6
[14E4165D]
;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_167d&subsys_0944103c
RequestedMediaType=6
[14E41647]
;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_167d&subsys_0944103c
RequestedMediaType=6
[14E41653]
;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_167d&subsys_0944103c
RequestedMediaType=6
[14E416C6]
;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_167d&subsys_0944103c
RequestedMediaType=6
[14E4167D]
;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_167d&subsys_0944103c
RequestedMediaType=6
[14E41646]
;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_167d&subsys_0944103c
RequestedMediaType=6
[14E41677]
;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_1677&subsys_0944103c
RequestedMediaType=6
[14E41696]
;Broadcom NetXtreme Gigabit Ethernet for hp (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_1696&subsys_0944103c
RequestedMediaType=6
[14E4167B]
;Broadcom NetXtreme Gigabit Ethernet (BCM5750A1M)
;ComponentId=pci\ven_14e4&dev_167b&subsys_0944103c
RequestedMediaType=6
[14E41645]
;Broadcom NetXtreme Gigabit Ethernet (BCM5701)
;ComponentId=PCI\VEN_14E4&DEV_1645
RequestedMediaType=6
[14E41659]
;Broadcom NetXtreme Gigabit Ethernet PCI Express (BCM5750A1)
;ComponentId=PCI\VEN_14E4&DEV_1659
RequestedMediaType=6
[14E416A6]
;Broadcom NetXtreme Gigabit Ethernet (BCM5702X)
;ComponentId=PCI\VEN_14E4&DEV_16A6
RequestedMediaType=6
[14E41644]
;Broadcom NetXtreme Gigabit Ethernet (BCM5700/5401)
;ComponentId=PCI\VEN_14E4&DEV_1644
RequestedMediaType=6
[14E41648]
;Broadcom NetXtreme Gigabit Ethernet (BCM5704)
;ComponentId=PCI\VEN_14E4&DEV_1648
RequestedMediaType=6
[14E416A7]
;Broadcom NetXtreme Gigabit Ethernet
;ComponentId=PCI\VEN_14E4&DEV_16A7
RequestedMediaType=6
[14E416C7]
;Broadcom NetXtreme Gigabit Ethernet
;ComponentId=PCI\VEN_14E4&DEV_16C7
RequestedMediaType=6
[14E416A8]
;Broadcom NetXtreme Gigabit Ethernet (BCM5704S)
;ComponentId=PCI\VEN_14E4&DEV_16A8
RequestedMediaType=6
[10B79805]
;3Com EtherLink Server 10/100 PCI (3C980C-TXM)
;ComponentId=PCI\VEN_10b7&DEV_9805
Duplexmode=FullDuplex
media=100FULL
[10B79800]
;3Com EtherLink Server 10/100 PCI (3C980B-TX)
;ComponentId=PCI\VEN_10b7&DEV_9800
Duplexmode=FullDuplex
media=100FULL
[10EC8139]
;Realtek RTL8139 Family PCI Fast Ethernet NIC
;ComponentId=PCI\VEN_10EC&DEV_8139
DuplexMode=5
[80861004]
;Intel PRO/1000 Gigabit Desktop Adapter
;ComponentId=PCI\VEN_8086&DEV_1004
SpeedDuplex=5
[80861008]
;Intel PRO/1000 Gigabit Desktop Adapter
;ComponentId=PCI\VEN_8086&DEV_1008
SpeedDuplex=5
[80861009]
;Intel PRO/1000 Gigabit Desktop Adapter
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861031]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861032]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861033]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861034]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861035]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861036]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861038]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861039]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[8086103A]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[8086103B]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[8086103C]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[8086103D]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[8086103E]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861050]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861051]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861052]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861053]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861054]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861055]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861056]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861057]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861059]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80862459]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[8086245D]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861064]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861065]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861066]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861067]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861068]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861069]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[8086106A]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[8086106B]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[808627DC]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861091]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861092]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861093]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861094]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861095]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[80861229]
; Intel 82557-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_1009
SpeedDuplex=5
[8086100C]
;Intel PRO/1000 Gigabit Desktop Adapter
;ComponentId=PCI\VEN_8086&DEV_100C
SpeedDuplex=5
[8086100E]
;Intel PRO/1000 Gigabit Desktop Adapter
;ComponentId=PCI\VEN_8086&DEV_100E
SpeedDuplex=5
[80862449]
;Intel 8255x-based PCI Ethernet Adapters
;ComponentId=PCI\VEN_8086&DEV_100E
SpeedDuplex=5

[80861010]
;Intel PRO/1000 Gigabit Desktop Adapter
;ComponentId=PCI\VEN_8086&DEV_1010
SpeedDuplex=5
[80861002]
; Intel(R) PRO/100 LAN+ModemV90 CardBus Adapters
;ComponentId=PCI\VEN_8086&DEV_1002
SpeedDuplex=5
[10222000]
;AMD PCNET Family Ethernet Adapter (PCI)
;ComponentId=PCI\VEN_1022&DEV_2000
EXTPHY=2
[11063106]
;VIA VT6105M Rhine III Management Adapter
;ComponentId=PCI\VEN_1106&DEV_3106
ConnectionType=2
[11063043]
;VIA VT86C100A Fast Ethernet Adapter
;ComponentId=PCI\VEN_1106&DEV_3043
ConnectionType=2
[11063065]
;VIA PCI 10/100Mb Fast Ethernet Adapter
;ComponentId=PCI\VEN_1106&DEV_3065
ConnectionType=2
[12829102]
;DAVICOM 9102-Based PCI Fast Ethernet Adapter
;ComponentId=PCI\VEN_1282&DEV_9102
ConnectionType=4
[10110009]
;DC21x4 Based Network Adapter Driver
;ComponentId=PCI\VEN_1011&DEV_0009
ConnectionType=9
[10B79200]
;3Com EtherLink XL 10/100 PCI For Complete PC Management
;ComponentId=PCI\VEN_10B7&DEV_9200
Media_type=100FULL
 
Do the PCs need to be rebooted/restarted for the changes to take effect or does the new registry entry dynamically refresh the network card speed ?
Thanks
 
Duplex option

It's dynamic, no need to reboot. Slight care required though as it does drop the network connection momentarily, worth considering if this is part of a script...
 
I have followed above post but the settings does not changes to Auto. It does change to 100 full but I need to make all the NIC to Auto. Also I want to run the vb script from my desk remotely on all 150 computers. Any help will be appreciated.
 
My script is like this..it reads the text file and output the result in text file. when I run it ...it gives me Syntex error line 40 character 1. Any help will be appreciated. I am new to vb scripting. Thanks.

ON ERROR RESUME NEXT
SET WshShell = WScript.CreateObject("WScript.Shell")
Const HKEY_LOCAL_MACHINE = &H80000002
Dim oFSO, oTS, strMachines, strComputer, oWindows, oLocator, oConnection, oSys
Set StdOut = WScript.StdOut

'open list of client names
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oTS = oFSO.OpenTextFile("c:\temp\nic.txt")
Set oFSO1 = CreateObject("Scripting.FileSystemObject")

'get WMI locator
Set oLocator = CreateObject("WbemScripting.SWbemLocator")

'create log file
set oFSO2 = createobject("Scripting.FileSystemObject")
Set newfile = ofso2.CreateTextFile("c:\temp\_NotReachable.txt")
Do Until oTS.AtEndOfStream

'get next client name
strMachines = oTS.ReadLine

For Each strMachines in oTS
'Connect to remote WMI
Set oConnection = oLocator.ConnectServer(strMachines,"root\cimv2")
Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}")._
ExecQuery("select * from Win32_PingStatus where address = '" & strMachines & "'")
'Ping Pc to see it it is turned on
For Each objStatus in objPing
If IsNull(objStatus.StatusCode) or objStatus.StatusCode<>0 Then
newfile.writeline("Computer (" & strMachines & ") is not reachable")
newfile.writeline("")

strComputer = ""
Set fso = CreateObject("Scripting.FileSystemObject")
Set objRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
sNetPath = "System\Currentcontrolset\Control\Class\{4D36E972-E325-11CE-BFC1-08002be10318}"

SetSpeedDuplex()
Sub SetSpeedDuplex()
Dim section, strValue, subkey, arrSubKeys

objRegistry.EnumKey HKLM, sNetPath, arrSubKeys
For Each subkey In arrSubKeys
objRegistry.GetStringvalue HKLM, sNetPath & "\" & subkey, "ComponentId", strValue
if not isnull(strValue) then
strValue = lcase(strValue)
section = left(replace(replace(strValue, "pci\ven_", ""), "&dev_",""), 8)
ReadDuplexIni section, subkey
end if
Next
End Sub

Sub ReadDuplexIni(section, subkey)
Dim ini, line, file

file = "spddplx.ini"
If fso.FileExists(file) Then
Set ini = fso.OpenTextFile(file, 1, False)
Do While ini.AtEndOfStream = False
line = ini.ReadLine
If lcase(line) = "[" & lcase(section) & "]" Then
line = ini.ReadLine
Do While Left(line, 1) <> "["
If left(line, 1) <> ";" and len(line) > 0 Then
UpdateReg line, subkey
End If
If ini.AtEndOfStream Then Exit Do
line = ini.ReadLine
Loop
Exit Do
End If
Loop
ini.Close
End If
End Sub

Sub UpdateReg(line, subkey)
Dim lRC

key = split(line, "=")
lRC=objRegistry.SetStringValue(HKLM, sNetPath & "\" & subkey, key(0),key(1))
End Sub
 
xcopy C:\Devcon\i386\Devcon.exe c:\
c:\devcon.exe remove =net
shutdown -s -t 90
pause


The above script will copy devcon.exe to the c:\
Open a command prompt
Navigate to the devcon.exe file copied in step 1
Remove the Network Adapter
Reboot the system in 90 seconds


I have written and tested this script and it works.


Enjoy
 
Back
Top