Batch script help

Soldato
Joined
23 Mar 2007
Posts
2,553
Location
Essex
Evening all

I was just wondering if someone could lend me a hand creating a small batch file. Basically all i want to do is create a batch that will launch the cmd and telnet into my router, if its possible would i be able to add my username and password to the script as well?

All i really would like to enter in the batch is

telnet 192.168.1.1

username

password

adsl info --stats

Hope someone can lend me a hand

thanks a mill
 
Thanks so much for that mate, the username and password is just the standard router one not windows. Is there such a command to input the data i want like a username and password?

If not do you know of any good thrid party telent clients? i have heard of putty but thats the only one off the top of my head

thanks so much again
 
Gave it a whirl this morning mate but for some reason it would not enter the username and password, this is what i put in the script

192.168.1.1 23
wait "login"
SEND "admin\m"
WAIT "password"
SEND "essien5\m"
WAIT ">"
SEND "adsl info --status\m"

When i run the batch

@Echo off
tst10.exe /r:script.txt
exit

It just gives me the logon screen for the telnet session



Uploaded with ImageShack.us

Thanks again for your help mate
 
Last edited:
Thanks again for the mate that seemed to work just fine i have edited the commands so they read exactly like the cmd

192.168.1.1 23
wait "Login:"
SEND "admin\m"
WAIT "Password:"
SEND "essien5\m"
WAIT ">"
SEND "adsl info --stats\m"

The only slight issue i have now is when i run the batch it just pops up then dissapears?

Thanks again for helping me out this i really appreciate it
 
Ah right thats where i was going wrong i was putting pause at the end of this script

192.168.1.1 23
wait "login"
SEND "admin\m"
WAIT "password"
SEND "essien5\m"
WAIT ">"
SEND "adsl info --status\m"
PAUSE

Thanks so much for helping me out it kinda makes sense now once you've got the jist of it. Can i just ask what does the \m command actually state? i understand /r mean "run" Also if i want data to be inputted via a script like this is it really as simple as putting "send" then the info i want?

thanks again matey
 
Sweet thanks so much for that mate i will av a look at that when i get in from work and have a play around with it. I take it those commands will actually only work with that program and not with just the CMD itself

Thanks so much again.
 
Back
Top Bottom