title: telnet output save it to file using .bat file
body: <p>telnet 10.0.0.22 3389 ( for checking rdp port )
  I want to create a batch file, for checking two or three port, so i create a .bat file in that i have written</p>
  
  <pre><code>telnet 10.0.0.22 1158 &gt;&gt; C:\result\telnetresult.txt
  telnet 10.0.0.22 3389 &gt;&gt; C:\result\telnetresult.txt
  telnet 10.0.0.22 1159 &gt;&gt; C:\result\telnetresult.txt
  </code></pre>
  
  <p>but it didn't work. Can you suggest where i am doing mistake or if there is some other alternative / Workaround.
  I also tried to create another .bat file with the following command.
  Telnet
  set logfile c:\log.txt</p>
  
  <pre><code>Open 10.0.0.22 80
  open 10.0.0.22 1158
  open 10.0.0.22 3389
  </code></pre>
  
  <p>but it also didn't work.</p>