Hi guys,
I need to have a script that prompts for an IP address to be entered and this then puts it in the field to change the IP. Currently I have to edit the script manually, save it then run it. The working code so far is:
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”)
Set colNetAdapters = objWMIService.ExecQuery _
(“Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=True”)
strIPAddress = Array(“192.168.xxx.xxx”)
strSubnetMask = Array(“255.255.255.0”)
For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
Next
I just want to have a user input box which prompts for the IP address and inputs this into the strIPAddress array.
Any clues? Sure its an easy one for a VB expert.
Thanks.