PDA

Click to See Complete Forum and Search --> : Change To Static IP


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.

TCS_Chuck
Jul 10th, 2005, 02:12 PM
vbNullChar NOT NullChar or CRLF. 2 little letters.....

TCS_Chuck
Jul 11th, 2005, 06:26 AM
now working on finding the ssid's and Wep info to be able to change this info in a script.

Anyone know where XP stores this information?

Hack
Jul 11th, 2005, 06:26 AM
vbNullChar NOT NullChar or CRLF. 2 little letters.....Did this solve the issue, or are you still having a problem?