Use the VBA Kill() function.
Example:
Kill "C:\Test\*.txt"
Yes, it will accept the ? and * wild cards. If you try to delete an open
file (if the application that has it open locks it, Notepad doesn't), you'll
get error 70 (Permission Denied). If the file is Read Only, you'll get error
75 (Path/File access error). If the file is marked as Hidden or System,
you'll get error 53 (File not found).
You can use the SetAttr statement to remove the hidden, system, and read
only attributes from the file. Again, it won't work on an open, locked file.
Example:
SetAttr "C:\Test\MyFile.txt", vbNormal
The SetAttr statement will not accept the wild cards.