There may be multiple reason why you want to create a text file in batch. But whatever the reason may be, this is how you do it.
If you want to overwrite an existing text file use
@echo off echo info to save > text.txt
But if you want to append text to an already existing text file use
@echo off echo info to save >> text.txt
If you need to save multiple lines of text to a file use
@echo off (echo username echo password)>text.txt