Gravity
Bekanntes Mitglied
Ich habe ein kleines Skript zusammengeschustert welches die lokale IP ermittelt und sie in einen Reg Key schreibt.
Grundsätzlich klappt es auch, nur einige Rechner haben mehrere NIC’s. VM, Bluetooth.
Wie erreicht man dass auch die aktive IP Adresse genommen wird?
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)
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite"HKCU\Software\Reflection\Rx 8.0\config\Server\DetectedLocalAddress", ""& IPConfig.IPAddress(i)
Next
End If
Next
Grundsätzlich klappt es auch, nur einige Rechner haben mehrere NIC’s. VM, Bluetooth.
Wie erreicht man dass auch die aktive IP Adresse genommen wird?
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)
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite"HKCU\Software\Reflection\Rx 8.0\config\Server\DetectedLocalAddress", ""& IPConfig.IPAddress(i)
Next
End If
Next