I wrote a batch file that could be opening a Telnet Session for me, how do I command the batch file to automatically set my log in username and password so that I don’t have to type my username and passwords every time I want to login into the session.
How to setup batch file for log in?
I’m not sure if you can create a batch file that automatically logs you in using telnet. But anyway, here are the commands used to somehow automate your telnet session:
telnet [-a][-e escape char][-f log file][-l user][-t term][host [port]]
-
-a – Attempt automatic logon. Same as -l option except uses the currently logged on user's name.
-
-e – Escape character to enter telnet client prompt.
-
-f – File name for client side logging
-
-l – Specifies the user name to log in with on the remote system. Requires that the remote system support the TELNET ENVIRON option.
-
-t – Specifies terminal type. Supported term types are vt100, vt52, ansi and vtnt only.
-
host – Specifies the hostname or IP address of the remote computer to connect to.
-
port – Specifies a port number or service name.
I’ve also managed to find a script that will indeed log you in automatically. Copy the following texts to notepad and then save it as .vbs [sample.vbs]:
Set cloner = CreateObject("WScript.Shell")
cloner.run"cmd"
WScript.Sleep 500
cloner.SendKeys"telnet 0.0.0.0"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"username here"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"password here"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
WScript.Sleep 300
cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
For other information, you may visit MSFN – Where People Go To Know — Telnet Bat file Auto login.