Disabling NetBIOS over TCPIP

1. Manual Procedure

Go to

  • Control Panel
  • Network and Sharing Center

 

netbios1

.

netbios2

Click “Change adapter settings

.

netbios3

Right-Click a Network Interface Card

Properties

.

netbios4

Select “Internet Protocol Version 4 (TCP/IPv4)

Properties

.

netbios5

Click “Advanced…

.

netbios6

Select “Disable NetBIOS over TCP/IP

.

.

2. Script

Here is a script allowing to disable NetBIOS over TCP/IP for all Network Interface Cards.

Option Explicit

On Error Resume Next


'Declarations
'---------------------------------------------------------------------------------------------------------------------------------
Const HKEY_LOCAL_MACHINE = &H80000002

Set strComputer = "." 
Set ObjWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")  
Set strKeyPath = "SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces" 


'Actions
'---------------------------------------------------------------------------------------------------------------------------------

'Get all interfaces  
ObjWMI.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys  
   
'Exit if error in getting strKeyPath 
If IsNull(arrSubKeys) Then WScript.Quit  
   
'Disable NetBIOS over TCP/IP for all Network Interface Cards
For Each Adapter In arrSubKeys  
    Msgbox("Disabling NetBIOS over TCP/IP on " & Adapter)
    objWMI.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & Adapter, "NetbiosOptions", 2  
Next 
   
Msgbox("Completed")