|
|
|
| 28 July 2003 | dnsSearchOrd() |
| Author | Olaf Gradin |
| Action | Changes client DNS search order based on your definition (through SELECT...CASE statement). Also makes differentation between Windows NT and 2000/XP. |
| Syntax | N/A |
| Parameters | |
| Remarks | Requires user to have read/write access to regsitry keys in SERVICES (Administrator). |
| Returns | N/A |
| Dependencies | fixPROD() -- OS category definition (2000/XP vs. NT) |
| Examples | $hidR = fixPROD() -- just to define $osCat, but could be done differently $hidR = dnsSearchOrd() |
| Source |
FUNCTION dnsSearchOrd () ; Client DNS search order (NT, 2000, & XP)
SELECT
CASE $locale = "x"
$searchlist = "x.com","y.com","z.net"
CASE 1
$searchlist = "y.com"
ENDSELECT
$regkey = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\TCPIP\Parameters"
$regval = "SearchList"
$regtyp = "REG_SZ"
$chkdns = ReadValue($regkey,$regval)
IF (@error <> 0) OR ($chkdns <> Join($searchlist," ")) OR ($chkdns <> Join($searchlist,","))
IF $oscat = "NT" ; NT Settings
$regexp = Join($searchlist," ")
WriteValue($regkey,$regval,$regexp,$regtyp)
ENDIF
IF $oscat = "2000" ; 2000 or XP Settings
$regexp = Join($searchlist,",")
WriteValue($regkey,$regval,$regexp,$regtyp)
ENDIF
ENDIF
ENDFUNCTION ; - dnsSearchOrd -
|
|
|
|