lazyrunner50
Programmer
Hey. Not sure if this is the right place to ask this, but I am trying to create a batch script that will open two windows (on an XP machine), log on to two Unix boxes using telnet, navigate to a directory and run a script I have created.
I know I can create a cron to run these scripts, but they require user input, so I would like to create a batch file that I can click on which will do the above steps.
I have looked all over the web, but can't find how to do it. I can find a lot of info on how to create batch scripts, but none of them mention how to automate the input of something like a login.
I would like to do something like this (syntax is incorrect since I don't really know how to create a batch file):
ECHO theUserName, thePassword | telnet theServer -->I am trying to pass the username and password to telnet, so it can login.
cd ~/myDir
./myScript
exit
ECHO theUserName, thePassword | telnet theSecondServer
cd ~/mySecondDir
./mySecondScript
exit
Is this possible?
I know I can create a cron to run these scripts, but they require user input, so I would like to create a batch file that I can click on which will do the above steps.
I have looked all over the web, but can't find how to do it. I can find a lot of info on how to create batch scripts, but none of them mention how to automate the input of something like a login.
I would like to do something like this (syntax is incorrect since I don't really know how to create a batch file):
ECHO theUserName, thePassword | telnet theServer -->I am trying to pass the username and password to telnet, so it can login.
cd ~/myDir
./myScript
exit
ECHO theUserName, thePassword | telnet theSecondServer
cd ~/mySecondDir
./mySecondScript
exit
Is this possible?