![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-02 04:44 |
48,037 topics / 350,122 posts / today 2 new / 48,250 members |
| DOS批处理 & 脚本技术(批处理室) » [Help] Extracting from a file by executing DOS commands |
| Printable Version 1,284 / 12 |
| Floor1 telneta | Posted 2006-09-27 05:59 |
| 新手上路 Posts 7 Credits 18 | |
|
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. |
|
| Floor2 namejm | Posted 2006-09-27 06:23 |
| 荣誉版主 Posts 1,737 Credits 5,226 From 成都 | |
|
Please describe the problem in a bit more detail. Also, the format of the contents in 1.txt is very important, please post part of it.
|
|
| Floor3 telneta | Posted 2006-09-27 06:25 |
| 新手上路 Posts 7 Credits 18 | |
|
Thank you so much
|
|
| Floor4 telneta | Posted 2006-09-27 06:26 |
| 新手上路 Posts 7 Credits 18 | |
|
Oops, I got excited just now and pressed ctrl+Enter
Let me describe it. The contents in 1.txt are all like this: 11.11.11.1 22.11.215.4 They are all IPs, with no spaces in between. I just want to be able to use a batch file to execute telnet on the IPs inside it. |
|
| Floor5 namejm | Posted 2006-09-27 06:32 |
| 荣誉版主 Posts 1,737 Credits 5,226 From 成都 | |
|
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?
|
|
| Floor6 telneta | Posted 2006-09-27 06:33 |
| 新手上路 Posts 7 Credits 18 | |
|
Thanks, I'll go test it.
My system is xp sp2 |
|
| Floor7 telneta | Posted 2006-09-27 06:35 |
| 新手上路 Posts 7 Credits 18 | |
|
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. Many thanks |
|
| Floor8 telneta | Posted 2006-09-27 06:37 |
| 新手上路 Posts 7 Credits 18 | |
Originally posted by namejm at 2006-9-27 06:32: I don't need it to pause. I just want to telnet the IPs in 1.txt in multiple windows. Thanks. |
|
| Floor9 namejm | Posted 2006-09-27 06:39 |
| 荣誉版主 Posts 1,737 Credits 5,226 From 成都 | |
|
You can use the code below to open multiple telnet windows:
|
|
| Floor10 electronixtar | Posted 2006-09-27 06:40 |
| 铂金会员 Posts 2,672 Credits 7,493 | |
|
telnet doesn't support reading commands from a file, don't bother trying it~
|
|
| Floor11 telneta | Posted 2006-09-27 06:45 |
| 新手上路 Posts 7 Credits 18 | |
Originally posted by namejm at 2006-9-27 06:39: Thank you so much. If anything comes up later, ``I'll still have to ask you for help. Thanks`` I'll remember you. |
|
| Floor12 vkill | Posted 2006-09-27 08:02 |
| 金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽 | |
|
This is the first time I've seen telnet used like this
|
|
| Floor13 pengfei | Posted 2006-09-27 09:30 |
| 银牌会员 Posts 485 Credits 1,218 From 湖南.娄底 | |
|
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.
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |