Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Credits 18 Posts 7 Joined 2006-09-27 05:54 19-year member UID 63776
Status Offline
For example, there is a file named 1.txt
I want to make a bat file
to implement this function:
open cmd.exe, then telnet the contents inside 1.txt. I don't know whether you can help me with this.
Credits 5,226 Posts 1,737 Joined 2006-03-10 00:38 20-year member UID 51697 From 成都
Status Offline
If you just want to telnet those IPs one by one, the code below will do, but this kind of batch telnet approach of yours is rather questionable: what's the use of telnetting so many IPs? You'd have to pause somewhere, right?
@echo off
for /f %%i in (1.txt) do telnet %%i
pause
Credits 18 Posts 7 Joined 2006-09-27 05:54 19-year member UID 63776
Status Offline
I tried it, and it works.
But I want to know if it can be done not in the same window. I want multiple windows opened.
That is, telnet the first IP,
then a second DOS window telnetting the second IP,
and so on.
Credits 18 Posts 7 Joined 2006-09-27 05:54 19-year member UID 63776
Status Offline
Originally posted by namejm at 2006-9-27 06:32:
If you just want to telnet those IPs one by one, the code below will do, but this kind of batch telnet approach of yours is rather questionable: what's the use of telnetting so many IPs? You'd have to pause somewh偠...
I don't need it to pause. I just want to telnet the IPs in 1.txt in multiple windows. Thanks.
Credits 1,218 Posts 485 Joined 2006-07-21 21:24 20-year member UID 58987 From 湖南.娄底
Status Offline
I've never tried having telnet read information from a text file, and I don't know whether it works. I only know that ftp can read input information from a text file.