I'm not sure of your syntax but this works.
name DefaultDir$+"\dummy.txt" as "C:\temp\e.txt"
this does not
name DefaultDir$+"\dummy.txt" as "C:\dummy\e.txt"
because in the first case the folder temp exists . In the second case the folder dummy does not exist.
If you are really trying to delete a file why not use
BTW if a is a folder don't you need the : after it.