Shortcuts and Wildcards
A number of Dos commands recognize certain shortcuts when navigating between directories. The best known of these are:
Many Dos commands associated with file handling (eg. ATTRIB, COPY, DEL, DELTREE, etc.) accept the use of the "wildcards" (* and ?).
In general terms, * refers to multiple characters and ? refers to a single character in a file or directory name.
It should be noted that not all commands handle wildcards in exactly the same way. For example DIR * and DIR *.* are considered synonymous but DEL * would delete only files without an extension.
Note also that when using long file names, the concept of "filename + extension" becomes somewhat confused. If a file name contains more than one period, Dos assumes that the last period separates the "filename" and the "extension" - however long that "extension" may be.
AnomaliesLarry Weiss pointed out that " " (a space enclosed by inverted commas) is accepted as a valid file specification by EDIT and DEL - albeit in rather different ways.
EDIT will open a file using the name of the current directory. Thus if the current directory is D:\data\docs\letters,
Actually, the number of spaces between the inverted commas can be anything from 1 to ? (over 15, anyway). If there are no spaces, EDIT displays an error message saying that it cannot open the file. A similar message is displayed if any path is included in the command.
DEL recognizes " " as *.* and will prompt for confirmation before deleting all files in the directory. As with EDIT, the number of spaces between the inverted commas does not seem significant but if there are no spaces an error message is displayed saying that a required parameter missing. Unlike EDIT, a path can be included and, if it is, no spaces between inverted commas are required. i.e. to delete all files in the current directory:
COPY also sees " " as *.* and, like DEL, accepts a path with it. Unlike DEL, there must always be a space between the inverted commas, even when a path is included.