Board logo

标题: [ 转帖] ListDirected Input for all Programs [打印本页]

作者: bagpipe     时间: 2006-8-22 16:54    标题: [ 转帖] ListDirected Input for all Programs

文章出处: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 [opt] "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
作者: electronixtar     时间: 2006-8-22 18:25
哇,好牛xxxxxxx,我顶!~~~~