I'm stuck here, and I really can use your help. Here's my situation.
Im looking forward to create a batch script which can access a unix server using telnet. Here the unix sever will ask for username/password. After it has authenticated the user, i want to preform some operations like chown on a perticular file.
Here's what im looking to do :
telnet
open xyz.abc.com
username
password
command 1
command 2
command 3
exit
where
xyz.abc.com is the unix server where i want to connect.
username and password are the credentials to access this server
command 1,command 2,command 3 are the commands i want to run in the server.
My problem is i cant use SSH. It should take all the data from the file instead of prompting the user to enter data and should run as an automated script.
This is the .bat file I created to telnet to a server, change a file permission, then ftp the file to my PC and open it. Hopefully it will help you out. The variable filename is there because I always login and move to the same directory name every time. You can change it to a prompt so the user can enter where they would like to cd to. Let me know if you have any questions.
Check out expect. Thie above is exactly what it's designed for.