You can't prevent expansion of macros/scripts within a Write File action. Either escape the file contents when storing in the macro (you can use the
Read File action or
vbld_GetFileContents script function) or use a Run Script action to write the raw macro value (you can use the
FileSystemObject).