| Цитата(Lyka @ 6.3.2010, 23:56) | Можно ли с помощью bat-файла переключать режим сетевой с Avto на 10Mbps и обратно? Если да помогите написать батник. |
знаю что через PowerShell можно получить настройки дуплекса , а вообще вот нашел. только сам не пробовал: Создаем файл spddplx.ini примерно такой....надо знать название | Код | [14e4165d] ;Broadcom 570x Gigabit Integrated Controller ;ComponentId=pci\ven_14e4&dev_165d&subsys_865d1028 RequestedMediaType=0
[10B79805] ;3Com EtherLink Server 10/100 PCI (3C980C-TXM) ;ComponentId=PCI\VEN_10b7&DEV_9805 Duplexmode=FullDuplex media=AUTO
|
потом создаем скрипт | Код | 'SetNICSpeed.vbs 'URL: http://www.petri.co.il/forums/showthread.php?t=14875 'URL: http://www.pcreview.co.uk/forums/showthread.php?t=2278296 '==========
Const HKLM = &H80000002
inputFile = "spddplx.ini"
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 = chr(34)& inputFile &chr(34) 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
|
надеюсь поможет
|