so i am trying to make a script that changes an IP address config for a windows XP computer. so far i have found a working script that does just what i need it to, however i need to find out how to add the DNS servers to it.
If anyone has any idea how to add this would you please let me know, Also i was thinking since i configure and reinstall a lot of computers on a daily basis is there a way to write a process script that when i run it, it will run the installers of the programs i need to install, for example after reformatting a computer i need to install the basics like my flash, adobe reader, IE8 ect...and if i could just run the script to install one then the next and then the next and then reboot that would be sweet. might be a long shot tho.
Code:
strComputer = "."
strConnection = "Local Area Connection"
strIP = Array("0.0.0.0")
strMask = Array("255.255.255.0")
strGatewayIP = Array("0.0.0.0")
' ------ END CONFIGURATION ---------
set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colNA = objWMI.ExecQuery("select * " & _
" from Win32_NetworkAdapter " & _
" where NetConnectionID = '" & strConnection & "'" )
for each objNA in colNA
set colNAConfig = objWMI.ExecQuery _
("ASSOCIATORS OF {Win32_NetworkAdapter.DeviceID='" & _
objNA.DeviceID & "'} " & _
" WHERE resultClass = win32_NetworkAdapterConfiguration ")
for each objNAConfig in colNAConfig
intRC = objNAConfig.EnableStatic(strIP,strMask)
intRC2 = objNAConfig.SetGateways(strGatewayIP)
if intRC = 0 and intRC2 = 0 then
WScript.Echo "IP address configured for " & strConnection
elseif intRC = 1 or intRC2 = 1 then
WScript.Echo "You must reboot for the changes to take effect for " & _
strConnection
else
WScript.Echo "There was an error configuring IP for " & _
strconnection & ": " & intRC & " and " & intRC2
end if
next
next
If anyone has any idea how to add this would you please let me know, Also i was thinking since i configure and reinstall a lot of computers on a daily basis is there a way to write a process script that when i run it, it will run the installers of the programs i need to install, for example after reformatting a computer i need to install the basics like my flash, adobe reader, IE8 ect...and if i could just run the script to install one then the next and then the next and then reboot that would be sweet. might be a long shot tho.