Jump to content

This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.

changing a computer's IP Address

2 replies to this topic


  • Full Members
  • 25 posts

Posted 28 November 2007 - 20:06

Hi Everyone,

Is it possible to change the IP Address through the Install? For example, if the target's computer IP Address is and it should be, can I do this through the install script?

Mike Goldweber


  • Full Members
  • 25 posts

Posted 28 November 2007 - 20:38

I couldn't find anything in DevStudio to change the IP Address; however I did find a command line alternative to this. I used the following:

netsh interface ip set address name="Local Area Network" static 1

where, = new IP address = Subnet mask = default gateway
1 = metric number



  • Full Members
  • 48 posts

Posted 29 November 2007 - 13:07

You could try to execute the following windows scripting host code from IS or to "import" it to script.
If you need help with that just say...


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
   & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colNetAdapters = objWMIService.ExecQuery _
   ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

strIPAddress = Array("")
strSubnetMask = Array("")
strGateway = Array("")
strGatewayMetric = Array(1)

For Each objNetAdapter in colNetAdapters
   errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
   errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
//    arrDNSServers = Array("xxx.xxx.xxx.xx")
//    objNetAdapter.SetDNSServerSearchOrder(arrDNSServers)  
   If errEnable = 0 Then
       WScript.Echo "The IP address has been changed."
       WScript.Echo "The IP address could not be changed."
   End If