Jump to content

how to convert ip to reg binary key.


voorock
 Share

Recommended Posts

I need to convert an adress ip for create a reg binary key in the registry.

These concern Alternative configuration IP.

How can I do for ?

If I have this information in my script :

IP :192.168.20.0

Mask : 255.255.255.0

What function for convert these in a reg binary key or hexa.

Thanks very much for yours solutions

To resume how can i obtain the red value in the reg key, with IP and Mask.

Dim $StrGUID, $Key

$IP = ("192.168.100.0")

$Mask = ("255.255.255.0")

;Read service name of the network card

$Key = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\", 1)

If @error <> 0 then ExitLoop

$StrGUID = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\" & $Key, "ServiceName")

;Activate Alternate Configuration

RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\" & $StrGUID, "ActiveConfigurations", "REG_MULTI_SZ", "Alternate_" & $StrGUID)

;Paramétrer Alternate Configuration avec Adresse IP et Masque

;Write the value"Options" sous HKLM\SYSTEM\CurrentControlSet\Services\Dhcp\Configurations

RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\Dhcp\Configurations\", "Options", "REG_BINARY", "32000000000000000400000000000000FFFFFF7FC0A800B701000000000000000400000000000000FFFFFF7FFFFFFF00")

;Write the key Alternate_{Valeur ServiceName} and the value "Options" under HKLM\SYSTEM\CurrentControlSet\Services\Dhcp\Configurations\

RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\Dhcp\Configurations\Alternate_" & $StrGUID, "Options", "REG_BINARY", "32000000000000000400000000000000FFFFFF7FC0A800B701000000000000000400000000000000FFFFFF7FFFFFFF00")

MsgBox(64, "Alternate Configuration", "Configuration alternative is OK with IP 192.168.100.0 and Mask 255.255.255.0")

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...