scripting@wanadoo.nl




dnsSearchOrd()

http://www.scriptlogic.com/kixtart/FunctionLibrary_FunctionList.aspx


actual FunctionLibrary list on 'Scriptlogic' site printer-friendly mirror of UDF topic on 'scripting@wanadoo.nl' site close
28 July 2003 dnsSearchOrd()
AuthorOlaf Gradin
Action Changes client DNS search order based on your definition (through SELECT...CASE statement). Also makes differentation between Windows NT and 2000/XP.
SyntaxN/A 
Parameters
  • none  
  • RemarksRequires user to have read/write access to regsitry keys in SERVICES (Administrator). 
    ReturnsN/A 
    DependenciesfixPROD() -- 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 -
     
      original source of UDF topic. show actual FunctionLibrary list on Scriptlogic site close top
              printer-friendly mirror of UDF topic on scripting@wanadoo.nl site  




    Copyright © 2003 www.scriptlogic.com & scripting@wanadoo.nl - last updated on 15 October 2003


    Site Meter