Write nameserver
I'm writing a little script for set to any network connection opendns as default nameserver for children protection.
For do this, for any connection I need to set the default dns with the key nameserver.
I'm working at school but I'm new with this sistem.
Can you help me ?
I've write this but it dont work :-(
Name "Prova"
OutFile "prova.exe"
!include "Registry.nsh"
!include "Sections.nsh"
Var RADIOBUTTON
Page components
Page instfiles
Section /o "Search for value 'Tcpip\Parameters\Interfaces'" SearchValue
${registry::Open} "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\Interfaces\" "/K=0 /V=1 /S=0 /B=1 /N='NameServer'" $0
StrCmp $0 0 0 loop
MessageBox MB_OK "Error" IDOK close
loop:
${registry::Find} "$0" $1 $2 $3 $4
MessageBox MB_OKCANCEL '$$1 "path" =[$1]$\n\
$$2 "value" =[$2]$\n\
$$3 "string" =[$3]$\n\
$$4 "type" =[$4]$\n\
$\n\
Find next?' IDOK loop
${registry::Write} "$1" "$2" "123.123.123.123,123.123.123.123" "$4" $vara
close:
${registry::Close} "$0"
${registry::Unload}
SectionEnd
Function .onInit
StrCpy $RADIOBUTTON ${SearchValue}
FunctionEnd
Function .onSelChange
!insertmacro StartRadioButtons $RADIOBUTTON
!insertmacro RadioButton ${SearchValue}
!insertmacro EndRadioButtons
FunctionEnd
I hope you can help me becouse I think is a 2 minute work for you :-)
Really thanks in any case.