dir foo
represents filenames, directory names, and partial or complete, absolute or relative paths - a normal variable would
represent only one or a few of those types.
>, >>, <, or | you are looking at redirection - the first of those redirects to a newly created or truncated file, the second appends to a file, the third reads from a file, and the fourth (a pipe) connects the output of one program to the input of the next. foo > nul redirects the output of foo - a program or command - to the null device to suppress display of normal, but not error messages. Redirection applies only to the command that precedes it on the same line. Pipes apply only to the two commands or programs which they separate.
*.txt matches all files with the .txt extension, *.t?? matches all files having three latter extensions that begin with 'T'. In addition to the formal wild cards, '.' often is translated a "*.*", that is, as all the files in the default directory, and ".." as all the files in the parent directory. These symbols are most commonly used to refer to the directory in relative directory references (CD ..\foo changes the default directory to the foo directory in the parent of the default directory). In some versions of DOS (COMMAND.COM actually), DIR ... will list all the files, including the hidden ones in the defualt directory, in other cases it will list just the subdirectories without name extentions but DIR, lists the files - not reliable or recommended.
** Copyright 1995, 1996, 1997, 1998 Ted Davis - all rights reserved **
Input and feedback from readers are welcome. NOTE: the subject of the message must contain the word "batch" for the message to get past the spam filter.
Back to the Table of Contents page
Back to my personal links page - back to my home page