China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

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!

中国DOS联盟论坛
The time now is 2026-08-02 23:48
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to input commands from a document View 714 Replies 1
Original Poster Posted 2006-12-31 15:01 ·  中国 湖南 娄底 冷水江市 电信
银牌会员
★★★
Credits 2,268
Posts 879
Joined 2006-12-19 16:23
19-year member
UID 73968
Gender Male
Status Offline
The contents of a.txt are as follows
dir
echo hello
copy e:\123\*.txt e:\111

Can I call the contents of a.txt directly from a batch file?
With the following method I can only get the contents of the first line. How do I get the lines after that?
The key is that I want to learn how to use the < symbol.
@echo off
set /p a=<a.txt
%a%
pause

[ Last edited by 26933062 on 2006-12-31 at 03:40 PM ]
Floor 2 Posted 2006-12-31 21:28 ·  中国 河北 廊坊 三河市 移动
初级用户
Credits 41
Posts 19
Joined 2006-12-15 00:10
19-year member
UID 73540
Gender Male
Status Offline
Forum Jump: