I recall some similar trouble back in Os3.0 relating to ed.
What I did was to rename ed to ed.exe and then write a small dos script wrapper for it and call that ed. The sript would use the protect command to set the protection bits before trying to open the file (and also attempts to after the executable quits).