how to make proper batch file to log into telnet

beliefs

Honorable
Aug 25, 2013
4
0
10,510
hi guys, im trying to open my nat thingy to forward ports for online game as in running single batch file if its possible , rather than copy pasting 4 times in a row , is there anyone who could give me an example how to make this work ? unsure , if username and password need to be there , just added them if i copypaste them manually

http://pastebin.com/59c9mjcJ ( same in spolier for less spam)

telnet 192.168.1.254
Admin
1143393225

:connection unbind application=CONE(UDP) port=69
:connection unbind application=CONE(UDP) port=3074
:connection unbind application=CONE(UDP) port=3478-3479
:connection unbind application=CONE(UDP) port=88

:connection bind application=CONE(UDP) port=55-66
:connection bind application=CONE(UDP) port=68-499
:connection bind application=CONE(UDP) port=501-5059
:connection bind application=CONE(UDP) port=5061-7647
:connection bind application=CONE(UDP) port=7649-27009

:connection bind application=CONE(UDP) port=27012-65353

thanks in advance!
 
Going to be hard with a bat file because of the timing. I am surprised you can get it to work with copy and paste. Problem is there is some un fixed amount of delay from the point it asks for a userid and then the password. Even the commands into the application may be sent too fast.

You can put the userid on the telnet command as a option which reduces 1 line. You then must put in delays between the commands with the sleep or timeout command.
 


in 4 times , i mean 4 times in copy paste from txt to cmd , just unconvient

my ports should be forwarded via ISP however my router has some x-anomaly, therefore I need to do this every time before i start to play FIFA16, just thought is there a bit more faster way via fast script or something