Skip to content
⌘ NSIS Forum Archive

Append to a file

2 posts

Tupsan#

Append to a file

Hi,

Is there a code to append a text to text file. I have the following code.

Function .onInit

# Params:
# 1) Title: "Owner Codes"
# 2) Caption: none
# 3) InitText: (enter owner code)
# 4) Max: 3
# 5) Button1: default
# 6) Button2: default
# 7) Return: $0
${InputTextBox} "Owner Codes" "Please, enter owner code" "" "2" "" "" 1

FunctionEnd

Section
# See if the user inputs something:
${if} $1 == "${NULL}"
DetailPrint "Operation was canceled!"
${else}
FileOpen $0 c:\Owner.txt w
FileWrite $0 "$1"
${endif}
SectionEnd

No I want the program to append one character to the file c:\Owner.txt.

Pls help.