![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Disable a network adapter Hi, How can I disable or enable a network adapter called 'Local Connection 1' using a script? Than for help on this regards jake |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Disable a network adapter "Jake" <jake44@newsgroup> wrote in message news:eaCrLbZQKHA.5052@newsgroup Quote: > Hi, > > How can I disable or enable a network adapter called 'Local Connection 1' > using a script? > > Than for help on this > > regards > > jake http://groups.google.com/group/micro...3fab1141c6c93e IMHO this is a rather clumsy solution. An alternative is to invoke devcon.exe from within your VB Script, which is not much better. The cleanest solution is probably to run devcon.exe from within a batch file, e.g. like so: @echo off goto Start --------------------------------------------------- Disable a device from the Command Prompt 16.4.2006 FNL --------------------------------------------------- :Start setlocal enabledelayedexpansion set Adapter=Broadcom NetXtreme Fast Ethernet set HWID=x set count=0 set found=no devcon.exe hwids "PCI\*" > c:\device.txt for /F "tokens=*" %%* in (c:\device.txt) do ( set /a count=!count! + 1 if /i "%%*"=="Name: %Adapter%" set found=yes& set count=1 if !found!==yes if !count!==3 set HWID=%%* ) if %found%==yes ( devcon disable "!HWID!" ) else ( echo Device "%Adapter%" not found. ) del c:\device.txt You can download devcon.exe from here: http://download.microsoft.com/downlo...240/devcon.exe. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Disable wireless network adapter when a laptop is docked? | Vista General | |||
| Fails to connect to network on boot, have to reset network adapter | Vista networking & sharing | |||
| Trouble getting Hyper-V Virtual Network to work with second Network Adapter | Virtual Server | |||
| Disable security to use WFI adapter? | Vista hardware & devices | |||
| Can't disable wireless network adapter in Device Manager | Vista hardware & devices | |||