DOS

Simple %var ou %%var
 FOR  %F IN (*.TXT *.DOC) DO COPY  %F F:

 FOR %%F IN (*.TXT *.DOC) DO COPY %%F F:

Either one will copy the items listed inside the brackets to the `F’ drive, but the second line is to be used in a batch file. DOS will eliminate the first percent sign preceding the `F’ character in each instance when used in a batch file. As with earlier examples, DOS will replace the variable `%F’ (or `%%F’) with the specified item(s). In the above example, the items are all the .txt and .doc files in the current directory.

One other thing I should mention is that two consecutive percent signs are also used in batch files when one wishes to echo, or to pass, a single percent sign; that is, when a single percent is needed to be seen on screen or in another file: