中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-02 01:26
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [ 转帖] ListDirected Input for all Programs 查看 943 回复 1
楼 主 [ 转帖] ListDirected Input for all Programs 发表于 2006-08-22 16:54 ·  中国 北京 联通
银牌会员
★★★
DOS联盟捡破烂的
积分 1,144
发帖 425
注册 2005-10-20 00:00
20年会员
UID 43784
来自 北京
状态 离线
文章出处:http://www.infionline.net/~wtnewton/batch/at.txt

@.COM : ListDirected Input for all Programs
(c) Ed Schwartz, Jul 95
===========================================

@.COM is a program that enables DOS to read program parameters not from
the comand line (as usual) but from an input file.

Syntax: @ prog < listfile

where: "prog" is *any* program or DOS command
(but *not* the SET command)

"listfile" is an ASCII text file that contains the parameters
for program "prog"

@.COM will read the first line of "listfile" and then execute "prog"
with this line as parameters. Then @.COM will continue with the 2nd
line of "listfile" and so on, until all lines of "listfile" have
been executed.

Example: assume you have a file DUMMY with the following contents:
*.bat
*.bak
*.old
and you call @ DEL < DUMMY
then the following commands will be executed:
del *.bat
del *.bak
del *.old

Please be sure that the last line of "listfile" is terminated with a CR/LF.


Local and global parameters:
The parameters of "prog" may be specified either on the command line or in
the listfile. You may call "@ DIR /W < listfile" . In this case the "/W"
has the same effect as if it were specified in every line of "listfile"

Keyboard input:
If you call @.COM without the "< listfile" part, it expects input from the
keyboard rather than from a file. @.COM will repeatedly read one line from
the keyboard and execute "prog" with this line as parameters. This will
save the repeated typing of the command name. Terminate @.COM by entering
Ctrl-Z.

Creating "listfile":
"listfile" may be created with any ASCII editor, or it may be the output
file of a DOS command like DIR. Assume, you want to delete the files *.BAK
and *.OLD in all (sub)directories of drives C: and D:

1. enter @ DIR /S/B > KILL from the command line
2. type C:\*.BAK <RET>
C:\*.OLD <RET>
D:\*:BAK <RET>
D:\*:OLD <RET>
Ctrl-Z <Ret>
3. enter @ DEL < KILL

Piping:
@.COM supports piping. Thus, if you need a more sophisticated file
selection you might for example use BORLAND's GREP.COM:
DIR /B | GREP "searchstring" | @ DEL


@.COM and batch files:
"prog" may be a batch file that gets it's parameters line by line from
"listfile". Within this batch these parameters may be used as usual
(%1, %2 etc)
If you call @.com from within a batch, you must call @@.COM (because @
as the first character on a batch line has a special meaning).

@.COM and the SET command:
Since @.COM launches a 2nd copy of COMMND.COM it will not work with
the SET command (like most shells, e.g. Norton Commander).

To get @.COM copy the following code to a file @.DEB. Then call
DEBUG < @.DEB
This will create @.COM. @.DEB may be deleted again.



e 100 8C 0E 7B 01 8C 0E 7F 01 8C 0E 83 01 BB 00 03 8B
e 110 E3 B1 04 D3 EB 43 B4 4A CD 21 8C C8 8E D8 8E C0
e 120 BF 97 01 BE 80 00 AC 04 02 A2 94 01 AC 3C 0D 74
e 130 03 AA EB F8 8B D7 B0 20 AA 42 FE 06 94 01 B9 01
e 140 00 BB 00 00 B4 3F CD 21 8B FA 3D 01 00 75 24 80
e 150 3D 1A 74 1F 80 3D 0A 75 E0 89 26 75 01 BB 77 01
e 160 BA 85 01 B8 00 4B CD 21 8C C8 8E D0 2E 8B 26 75
e 170 01 EB A7 CD 20 00 00 00 00 94 01 00 00 5C 00 00
e 180 00 6C 00 00 00 43 3A 5C 43 4F 4D 4D 41 4E 44 2E
e 190 43 4F 4D 00 00 2F 43
r cx
97
n @.COM
w
q
2 发表于 2006-08-22 18:25 ·  中国 四川 成都 教育网
铂金会员
★★★★
积分 7,493
发帖 2,672
注册 2005-09-02 00:00
20年会员
UID 42173
性别 男
状态 离线
哇,好牛xxxxxxx,我顶!~~~~

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
论坛跳转: