Enable/Disable TCP/IP via a Script

ThunderIT
ThunderIT used Ask the Experts™
on
We have a 3rd party that has setup some laptops with some specialized statistical software. Their software communicates to their server via IPX. They say that TCP/IP causes problems with their software and that collisions on the network cause delays. We obviously don't want to enable TCP/IP all the time if this causes problems. However we do have the need to transfer files another server at certain points throughout the day. The idea would be to create a script that would enable TCP/IP, copy the files to the appropriate server, and then disable TCP/IP.

Because of this i'm looking for a way to enable & disable the entier TCP/IP protocol for the NIC via a script. (VBS, Bat, etc) Is this possible? We already have the scripting needed for transfering the files and such. We just need to be able to enable and disable TCP/IP.

Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
The only way what say would seem right - about collisions - is when NetBIOS over TCP/IP is enabled.

Use this script to disable it.


On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery _
    ("Select * From Win32_NetworkAdapterConfiguration")
For Each objNetCard in colNetCards
    objNetCard.SetTCPIPNetBIOS(2)
Next

Open in new window

Commented:
I've also added a line to disable LMHosts
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery _
    ("Select * From Win32_NetworkAdapterConfiguration")
For Each objNetCard in colNetCards
    objNetCard.SetTCPIPNetBIOS(2)
    objNetCard.WINSDisableLMHostsLookup
Next

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial