Jump to content
Sign in to follow this  

how to convert ip to reg binary key.

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 :

Mask :

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 = ("")

$Mask = ("")

;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 and Mask")

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.