Syntax |
Kill filespec$ |
||
Description |
Deletes all files matching filespec$. |
||
Comments |
The filespec$ argument can include wildcards, such as * and ?. The * character matches any sequence of zero or more characters, whereas the ? character matches any single character. Multiple *'s and ?'s can appear within the expression to form complex searching patterns. The following table shows some examples. |
||
|
This Pattern |
Matches these Files |
Doesn't match these Files |
|
*S*.TXT |
SAMPLE.TXT |
SAMPLE |
|
C*T.TXT |
CAT.TXT |
CAP.TXT |
|
C*T |
CAT |
CAT.DOC |
|
C?T |
CAT |
CAT.TXT |
|
* |
(All files) |
|
Example |
This example looks to see whether file test1.dat exists. If it does not, then it creates both test1.dat and test2.dat. The existence of the files is tested again; if they exist, a message is generated, and then they are deleted. The final test looks to see whether they are still there and displays the result. Sub Main() If FileExists ("test1.dat")
Then If FileExists ("test1.dat")
Then |
||
See Also |
Name (statement). |
K |