Start (multiple) programs on MSFS startup with this exe.xml 'tip'

I’ve a program in the EXE.XML that writes a file in it’s own directory (D:/file/) before ending the program . That doesn’t work.
If I start the program via it’s Icon all worked fine. The file will be written to the right place. If I start it via EXE.XML it will start but it will fail to write the file. (Failed to file… The medium is write protect)