Hide Comments

Many internal commands allow you to specify a file containing a list of all of the files you want to process in the command line (instead of enumerating them individually). You specify that a file is a file list by prefixing its name with the @ sign, e.g., LIST @XXX specifies that LIST is to operate on the files listed in the file XXX instead of on XXX itself.

 

A file list is simply a standard text file containing the names of the files to process, one per line. This allows you to create a list of files for processing using output from DIR /B, DIR /F, or FFIND, a text editor, or any other method that produces a file in the proper format. Both absolute and relative paths may be included in the file, However, wildcards are ignored, and each line is processed literally, without any further checking. This means that if a command allows options to restrict operations based on age (/U, /C), ranges (/I..., /[d..., /[t...), attributes (/A:), or location (/S), those restrictions will be ignored when processing the @file contents.

 

Commands supporting the @File syntax include:

 

ATTRIB

FOR

TAIL

COPY

HEAD

TOUCH

DEL / ERASE

LIST

TYPE

DESCRIBE

MOVE

ZIP

DO

RD / RMDIR


EXCEPT

REN / RENAME


 

 

To use a file list, precede its name with an @ sign in the command. For example, to copy all of the files listed in MYLIST.TXT to D:\SAVE\:

 

copy @mylist.txt d:\save\

 

If you use a drive and/or path specification the @ sign can appear before the path or before the file name. For example, these are equivalent:

 

copy @e:\lists\mylist.txt d:\save\

copy e:\lists\@mylist.txt d:\save\

 

To use appropriately formatted data on the Windows clipboard as an catalog file use @CLIP: as the file name, for example:

 

copy @clip: d:\save\

 

@File Lists and "@" Signs in File Names

 

Note that the @ sign is a rarely used, but legal filename character in Windows. If a file whose name begins with @ exists and you attempt to use an @file list with the same name, the file whose name begins with @ will take precedence. For example, if C:\ contains both a file named @MYLIST.TXT and another named MYLIST.TXT, this command:

 

[c:\] copy @mylist.txt d:\save\

 

will copy the single file @MYLIST.TXT to D:\SAVE\, and will not process the list of files in MYLIST.TXT. To avoid this confusion, use a different name for one of the files.