中国DOS联盟论坛

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-11 05:32
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » [Fixed] What do I do if << can't be used in a batch file? Can everyone help?
Printable Version  847 / 3
Floor1 gdyabc Posted 2009-01-11 21:01
初级用户 Posts 37 Credits 41 From 四川南充
I have a text file, name.txt, with only one line in it as follows:
B190

I wrote a batch file with the following contents:
When I run this batch file, it just flashes by, sweat, sweat
So I changed the bat, changing ping -a -n 4 -r 5 <<name.txt
to ping -a -n 4 -r 5 <name.txt
Then it shows: IP address must be specified.
I remember that on a Win98 machine I used <<, but now on WinXP I can't see any effect. What should I do? Is the command wrong?
At first I thought maybe you couldn't use a computer name and had to use an IP; but after I changed it to an IP, it was still the same effect, sweat, sweat, sweat, sweat. I'd appreciate some guidance from the seniors, many thanks!

[ Last edited by HAT on 2009-1-13 at 14:33 ]
Floor2 teaterr Posted 2009-01-12 13:59
新手上路 Posts 4 Credits 4
Maybe you wrote it backwards, it should be >>, right.
Floor3 exzzz Posted 2009-01-12 14:31
初级用户 Posts 167 Credits 194
No idea why this happens... let's wait together.

If it's urgent, use the temporary workaround below:
for /f %%i in (name.txt) do ping -a -n 4 -r 5 %%i
Floor4 gdyabc Posted 2009-01-13 13:22
初级用户 Posts 37 Credits 41 From 四川南充
Many thanks to post #3.
Also thanks to post #2, but maybe post #2 didn't understand what I meant
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023