I have scripted DynDNS.bat to determine if Dynamic DNS Registration is enabled on a Windows XP client.

The syntax for using DynDNS.bat is:

Call DynDNS YesNoX

Where YesNoX is a call directed environment variable that will contain a X if the client is NOT a Windows XP computer, a Y if Dynamic DNS Registration is enabled, and a N if Dynamic DNS Registration is NOT enabled.

DynDNS.bat contains:

                              @echo off                              setlocal ENABLEDELAYEDEXPANSION                              if \{%1\}==\{\} goto syntax                              set DNSREG=N                              if not exist "%SystemRoot%\System32\reg.exe" goto notxp                              set XP=reg.exe query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion"                              for /f "Tokens=1-3" %%u in ('%XP%^|Find "5.1"^|Find /i "CurrentVersion"') do (                               if /i "%%u" NEQ "CurrentVersion" goto notxp                              )                              for /f "Tokens=3 Delims=\[\] " %%i in ('ping -n 1 "%computername%" ^|find /i "Pinging"') do (                               set IP=%%i                              )                              if not defined IP goto error                              set IP=%IP: =%                              set int1=reg.exe query HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces                              for /f "Tokens=*" %%a in ('%int1%^|Find "\{"') do (                               set ikey=%%a                               if "!DNSREG!" EQU "N" call :IsInt                              )                              endlocal&set %1=%DNSREG%&exit /b 0                              :notxp                              set DNSREG=X                              endlocal&set %1=%DNSREG%&exit /b 0                              :syntax                              @echo call DynDNS YesNo \[PathToReg.exe\]                              endlocal                              exit /b 1                              :error                              @echo DynDNS - Error retrieving IP address.                              endlocal                              exit /b 2                              :IsInt                              set IPFnd=N                              set int2=reg.exe query %ikey%                              for /f "Tokens=*" %%i in ('%int2%^|Find "%IP%"^|Find /i "IPAddress"') do (                               set IPFnd=Y                              )                              if "%IPFnd%" EQU "N" goto :EOF                              for /f "Tokens=3" %%i in ('%int2%^|Find /i "RegistrationEnabled"') do (                               if "%%i" EQU "0x1" set DNSREG=Y                              )