We are working on converting the wiki to a static website controlled by markdown files in https://github.com/nsis-community. You can already see there how plug-ins will be posted. The end-user interface will still be a website but with a fresh coat of paint. Come meet us at Discord to talk about it.

Write text to a file

From NSIS Wiki
Jump to navigationJump to search
Author: rainmanp7 (talk, contrib)


Description

This example shows you how to write text to a new file.

For more advanced examples, see Reading and Writing in files.

The Script

FileOpen $9 apachesrvin.bat w ;Opens a Empty File and fills it
FileWrite $9 "cd $INSTDIR\apache$\r$\n"
FileWrite $9 "apache -n Apache -k install$\r$\n"
FileWrite $9 "net start Apache$\r$\n"
FileWrite $9 "exit$\r$\n"
FileClose $9 ;Closes the filled file