I need to make a script that can write one line of text to a text file in the same directory as the batch file.
It's easier to use only one code block, then you only need one redirection.
( echo Line1 echo Line2 ... echo Last Line ) > filename.txt