2 Replies Latest reply on Mar 13, 2013 9:37 PM by R-Bala-Krishnan

    Reg: Get IP config values through javascript

    R-Bala-Krishnan Level 2

      Hi All,

       

      please let me know, how to get the DNS Suffix name using javascript.

       

      ip.JPG

      --

      Thanks

      Bala

        • 1. Re: Reg: Get IP config values through javascript
          -hans- Level 4

          Hi,

           

          I don't know, but running a *.bat via ES and piping the res of the *.bat to txt-file would give you the ability to get the requested.

           

          Anything like this:

           

           alert(ipConfig())
            function ipConfig(){ 
          var batString = 'cd c:\\ \n ipconfig  ' +   ' >' +'curripconfig.txt' 
                 
              var _file = new File('~/tmp.bat');   
                  _file.open( 'w' );    
                  _file.encoding = 'UTF-8';    
              _file.writeln ( batString );    
              _file.close();    
              _file.execute();   
               
             var  resFile = File('c:\\curripconfig.txt' ) 
              while(!resFile.exists){ 
                                                  $.sleep(500); 
                  }     
               
                  resFile.open( 'r' );    
             var   toRead =   resFile.read(); 
               resFile.close(); 
              resFile.remove(); 
              _file.remove(); 
          
               return toRead; 
              }
          

           

          Hope it'll be of some help ;-)

           

          Hans-Gerd Claßen

          1 person found this helpful