I have this code:
@echo off
color 0a
title FTP
CLS
echo username > FTP.txt
echo password >> FTP.txt
ftp -s:FTP.txt ftp.website.com
But I have the problem that it shows an error in authentication on execution because a space is appended on username
and password
in text file. It other words first line of FTP.txt
is "username
" and not "username
". Also second line is "password
" and not "password
".
How to delete those spaces at end of each line or avoid writing them into the file?