Set args = WScript.Arguments Dim ipPrefix ipPrefix = "192.168.200" If args.Count > 0 Then ipPrefix = args(0) End If WScript.Echo "ipPrefix:" + ipPrefix ipconf = getCommandOutput("ipconfig") ipConfLines = Split(ipconf,vbCrLf) For Each line in ipConfLines IF InStr(line, "IPv4") Then If InStr(line, ipPrefix) Then backendIp = Mid(line, InStr(line, ipPrefix)) command = "netsh interface ipv4 set address name=""Private""" command = command & " source=static address=" & Trim(backendIp) command = command & " mask=255.255.255.0" WScript.Echo getCommandOutput(command) WScript.Echo getCommandOutput("netsh interface ipv4 set address name=""Private"" source=static address=" & Trim(backendIp) & " mask=255.255.255.0") End If End If Next ' Sleep for 30 seconds while network configures WScript.Sleep 30000 Function getCommandOutput(theCommand) Dim objShell, objCmdExec Set objShell = CreateObject("WScript.Shell") Set objCmdExec = objshell.exec(thecommand) getCommandOutput = objCmdExec.StdOut.ReadAll End Function