Results 1 to 4 of 4

Thread: NIC

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Nov:2010
    Location: zoofia
    Posts: 9

    NIC

    ,
    VBS , . - .
    . , - . ( ) + VBS .
    - , . .
    Win 2003 SP2/R2/Enterprise Win2008 SP2/R2 Standard Enterprise etc.

    , , . . devicedisable.exe , .

    ----------


    '######################Script for disconnecting NIC`s############
    'Disable disconnected NICs by using the device disable utility for Windows x86 x64
    'Prerequisite: devicedisable.exe
    'author Jordan Radkov------------------------
    'date '7/13/2011
    'version 1.1 Excluded all popups and notifications so action can be performed in the background
    'No notifications will appear even if no NICs are found and the result


    'In the next line you have to define the physical location for devicedisable.exe
    sDevcon = "C:\temp\NICScript\devicedisable.exe "
    iEthernet = 0: iWireless = 9
    Set oWshShell = CreateObject("WScript.Shell")


    'Generate a list of all devices


    Set oExec = oWshShell.Exec(sDevcon & " HWIDs *")
    WScript.Sleep 5000
    sResult = ""
    While Not oExec.StdOut.AtEndOfStream
    sResult = sResult & oExec.StdOut.ReadLine & "|"
    Wend
    aDeviceInfo = Split(sResult, "|")

    'Check which adapters are disabled

    Set oWMIService = GetObject("winmgmts:\\.\root\CIMV2")
    Set colItems = oWMIService.ExecQuery(_
    "SELECT * FROM Win32_NetworkAdapter", , 48)
    For Each oItem In colItems
    If (oItem.AdapterTypeId = iEthernet _
    Or oItem.AdapterTypeId = iWireless) _
    And oItem.NetConnectionStatus = 7 _
    Then DisableAdapter(oItem.Name)
    Next

    'Disable disconnected adapters

    Sub DisableAdapter (sName)
    For i = 0 To UBound(aDeviceInfo) - 1
    If LTrim(aDeviceInfo(i)) = "Name: " & sName Then

    Set oExec = oWshShell.Exec(sDevcon _
    & " disable " & aDeviceInfo(i+2))
    Do
    WScript.Sleep 200
    Loop Until oExec.Status = 1
    End If
    Next
    End Sub

    ------


    , . echo. , "Cable Unplugged" .
    UAC . .
    Last edited by dann_radkov; 14th July 2011 at 15:11. Reason:

  2. #2
    Outcast DeathKnight's Avatar
    Join Date: Jul:2003
    Location:
    Posts: 1,772
    ?
    , devcon.exe?
    ?

    ?
    , , template Adwords , firewall-a , ... <template>

  3. #3
    Registered User
    Join Date: Nov:2010
    Location: zoofia
    Posts: 9
    Quote Originally Posted by DeathKnight View Post
    ?
    , devcon.exe?
    ?

    ?
    Devcon.exe - 2003. , 2003 . 7 .
    .
    . . , .

    --------- 07:32 --------- : 05:43 ---------

    . 7-8 , 1 , - 8 . 8 - 1 .
    NC532i Dual Port 10GbE Multifunction BL-c adapter #2 e EBDRV\L2ND
    NC532i Dual Port 10GbE Multifunction BL-c adapter #3 EBDRV\L2ND
    Ė .
    .
    ( ) hardware ID. .

  4. #4
    Registered User
    Join Date: Nov:2010
    Location: zoofia
    Posts: 9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |