Sign in with
Sign up | Sign in
Your question

Batch file for Remote Computer

Last response: in Networking
Share
September 26, 2011 3:54:51 PM

Hi!

i'm trying to write a simple batch file to make my life easier. We have a few dozen Aix Boses that we telnet into and about 70 as400 Swift systems we telnet into.

I was starting on a batch file like the one below where i could run it, type in the system and it log me over.
What I want to add is for it to put in my user name. (if i could draw a password from a excel file that would be fantastic but id settle for just my user name). I have tried - l (username) at the end of telent and it didn't work. also tried -a. i keep getting the box with user name/password and there both blank.

Any ideas how i can get it to type in my user name?


here is my script.

@echo off
set /p name= What system are you logging into?
telnet %name%

i tried start script.vbs as another attempt using this info

Set cloner = CreateObject("WScript.Shell")
cloner.run"cmd"
WScript.Sleep 500

cloner.SendKeys"telnet %name%"
cloner.SendKeys("{Enter}")
WScript.Sleep 500

cloner.SendKeys"my username"
cloner.SendKeys("{Enter}")
WScript.Sleep 500

cloner.SendKeys"my password"
cloner.SendKeys("{Enter}")
WScript.Sleep 500

cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
WScript.Sleep 300

cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
September 26, 2011 5:32:42 PM

i tried something basic like my batch file is

@echo off
set /p system=What system do you want to log into?

telnet %system%
m
0
l
September 26, 2011 7:10:19 PM

Is your username and password always the same for each system?
m
0
l
!