Jump to content

xero

Members
  • Gesamte Inhalte

    4
  • Registriert seit

  • Letzter Besuch

Beiträge erstellt von xero

  1. Hallo THUMB,

     

    das ist genau mein Problem - sorry. Ich kann beide Scripte nicht miteinander kombinieren :mad: . Nach dem Motto: Lies mir die (alle) IP-Adresse(n) und Subnet-Maske(n) aus. Danach ändere nur die Subnet-Maske(n) ...

    # # # Script # # #

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:" _

    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

     

    Set colNetAdapters = objWMIService.ExecQuery _

    ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

     

    Set IPConfigSet = GetObject("winmgmts://.").ExecQuery("select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

    For Each IPConfig In IPConfigSet

    If Not IsNull(IPConfig.IPAddress) Then

    For i=LBound(IPConfig.IPAddress) To UBound(IPConfig.IPAddress)

    IPADDRESS = IPConfig.IPAddress(i)

    'MsgBox IPADDRESS

    'Next

    End If

    'Next

     

    strIPAddress = Array(IPADDRESS)

    strSubnetMask = Array("255.255.0.0")

    'strGateway = Array("192.168.1.100")

    'strGatewayMetric = Array(1)

     

    For Each objNetAdapter in colNetAdapters

    errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)

    'errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)

    If errEnable = 0 Then

    WScript.Echo "The IP address has been changed."

    Else

    WScript.Echo "The IP address could not be changed."

    End If

    Next

    # # # Script-Ende # # #

     

    Ergebnis: Fehlerabbruch in Zeile 15 - Anweisung erwartet (Fehler)

     

    Gruß

    xero

×
×
  • Neu erstellen...