TCS_Chuck
Jul 10th, 2005, 08:47 AM
I have a script I am working on that needs to change the registry settings of the active Wireless NIC.
It Turns on and of DHCP Mode and will add the static information.
Where my problem is at is in the REG_MULTI_SZ,,, I think. What is happening is the Gateway and IP are being added but it is also adding garbage to the string.
Here is my Multi_Sz Code
Public Sub SaveMultiSZ(hkey As Long, strPath As String, strValue As String, strdata As String)
Dim keypath As Long
Dim w As Long
w = RegCreateKey(hkey, strPath, keypath)
w = RegSetValueEx(keypath, strValue, 0, REG_Multi_SZ, ByVal strdata, Len(strdata))
w = RegCloseKey(keypath)
End Sub
It could be as simple as needing to add a carriage return at the end on the IP address but forgot the Command to do this.
It Turns on and of DHCP Mode and will add the static information.
Where my problem is at is in the REG_MULTI_SZ,,, I think. What is happening is the Gateway and IP are being added but it is also adding garbage to the string.
Here is my Multi_Sz Code
Public Sub SaveMultiSZ(hkey As Long, strPath As String, strValue As String, strdata As String)
Dim keypath As Long
Dim w As Long
w = RegCreateKey(hkey, strPath, keypath)
w = RegSetValueEx(keypath, strValue, 0, REG_Multi_SZ, ByVal strdata, Len(strdata))
w = RegCloseKey(keypath)
End Sub
It could be as simple as needing to add a carriage return at the end on the IP address but forgot the Command to do this.