You're already doing it correctly. You're writing the string "a$" to text file 2, and when you call "close file 2", the file is guaranteed to be saved.
Probably a better way is to read until "file end" returns true:
cls
open to read 1,"DMH 00.txt"
open to write 2,"DMH 00 n.txt"
if file open(1) and file open(2)
repeat
read string 1,a$
write string 2,a$
until file end(1)
else
print "failed to open both files!"
endif
close file 1
close file 2 : `<<<<<<<<<<< This effectively saves the file to disk already.
print "done!"
wait key
end