i like the convenient Bundle Features to edit Text Files directly: "Specify Contents of the File" / "Define your own script".

However it seems to produce non consistent results. This is what found with the "edit text file action" so far:

if i use curly braces in the text file the action would fail if the file already existed. Errormessage:
An error occured while performing the "Edit Text File Action" action. The error message is - "{1}".
if i use for example %localappdata% it would resolve to c:\windows\system32\config\systemprofile\AppData\L ocal if run the first time. If the User Clicks "Verify" it will resolve to the users appdata and still edit the file with SYSTEM permissions.

Questions: how can i escape Variables like %appdata% if i need them literally in a text file?

How can i avoid problems with curly braces and eventually other chars?

e.g. vbs-script:
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

i assume the rules are the same for "Define your own script"/"Specify Contents of the File"?

best regards