hi,
We are using USB network adapter and want to disable netbios over tcpip, but due the use of USB de interface is de NIC is not fixed.
IS there a way to disable netbios tcpip over all adapter
some code found but works only for a fixed adapter need som extra help.
insRoot = regopenkey(@regmachine,"SYSTEM\CurrentControlSet\Services\NetBT\Parameters\Interfaces")
NicReg = regopenkey(WinsRoot,"Tcpip_{974CB562-BB31-4E89-BA72-5B64150DE5F5}") ; This tells it what nic to look at, you may need to check on your pc
OldSetting = regqueryvalue(nicReg,"[NetbiosOptions]")
regsetvalue(NicReg,"[NetbiosOptions]",0) ; Use Netbios setting from DHCP Server
regsetvalue(NicReg,"[NetbiosOptions]",1) ; Enable Netbios over TCP/IP
regsetvalue(NicReg,"[NetbiosOptions]",2) ; Disable Netbios over TCP/IP
regclosekey(NicReg)
regclosekey(WinsRoot)
Pam
NetBios over tcp ip can't be disabled via group policy so you would need to cycle through all the adapters under 'intrfaces' and disable each in turn. Of course the trick would be to do this after your USB adapter is present on the system.
One way to handle checking for additional interface would be to set up a scheduled task. Another would be to create a service script that performed background checking on a regular bases. In ether case, the RegQueryKeys function could be used to obtain the current list of network interfaces as defined in the Registry.
Hi,
An other way is HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces
There are about 17 adapter below this interface is there a way to disable all the change the NetbiosOptions=0 to 2 on all the interfaces
pam
Is this a question? if so, what I think you are describing is what the previous two responses were about. You can use RegQueryKeys to get the key names of those 17 adapters under 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces'. Once you have the names you can concatenate each name to the registry path and change the NetbiosOPtions value of each key to 2.
If I am not interpreting your post correctly, I apologize and please explain further.
Hi,
Sorry my English is not so good, it was a question how to do that.
Pam
My written English leaves a lot to be desired so I can empathize. Looks like it is time for a bare bones example:
; Get a list of registered interface.
strRegIface = 'SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces'
hIfaces = RegOpenKey(@REGMACHINE, strRegIface)
lIfaces = RegQueryKeys(hIfaces)
; Disable all interfaces.
nIfaces = ItemCount(lIfaces, @Tab)
for i = 1 to nIfaces
RegSetValue(hIfaces, ItemExtract(i, lIfaces, @Tab):'[NetbiosOptions]','2')
next
RegCloseKey(hIfaces)
:)thx,
I inadvertently left a break statement in the above script when I originally posted the script. It has since been removed.