ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nehal Patel <nehalhpatel...@gmail.com>
Subject ANT script to telnet to Windows 2008 R2 server.
Date Thu, 01 Mar 2012 04:54:19 GMT
Hello,
I'd like to use telnet and connect to another Windows server; yes TELNET
Server is installed on the target server.  Here is my task:
<target name="connect-by-telnet">
<telnet server="BIGBIRD" userid="bert" password="ernie">
<read>$</read>
<write>dir > test.txt</write>
<read>$</read>
</telnet>
</target>


And here is my output:
D:\User1>C:\apache-ant-1.7.1\bin\ant -buildfile
 install-deploy.xml
Buildfile: install-deploy.xml

main:

connect-by-telnet:
   [telnet] Welcome to Microsoft Telnet Service
   [telnet]
   [telnet]
   [telnet] login:
   [telnet] bert
   [telnet]  bert
   [telnet]
   [telnet] password:

(and it just hangs)


First question = should i login manually to know what my promt will look
like, so i can use it in "<read>$</read>" statement?  Should it look like
"<read>C:\Documents and Settings\Bert></read>" instead?

Second question = why is i hanging?

I just want to connect, do a DIR and output to a txt file, and then quit.

Thank you in advance.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message