Reputation: 48
I have a bit of code that will send some info to my FileZilla FTP server that is running on a PC of mine. When I enter the password I want and place it in the login spot in my code and run it. It keeps saying it is a Incorrect password and failing even when I KNOW that the password in there is correct. Someone have an answer?
1 I have tried to change the password many times and even simple ones like 123 and it still did not say it was correct | 2 I changed the security on the server many time as well and to nothing in return | 3 I have reinstalled Filezilla many times | 4 I changed firewall settings |
REM Setup the FTP folder
echo reverseCMD > a.dat
echo *********** >> a.dat
echo binary >> a.dat
echo mkdir %username% >> a.dat
echo cd %username% >> a.dat
echo put Info.txt >> a.dat
echo disconnect >> a.dat
echo bye >> a.dat
*** Removing IP's and passwords
Upvotes: 0
Views: 110
Reputation: 49167
Are you aware of the fact that all lines of your batch file output with echo
are written with a trailing space into file a.dat
because of space left to redirection operators >
and >>
?
See the answer on Why does ECHO command print some extra trailing space into the file? for details about how a command line with echo
and a redirection operator is processed by cmd.exe
.
I suggest the following code:
@echo off
REM Setup the FTP folder
(
echo reverseCMD
echo ***********
echo binary
echo mkdir %username%
echo cd %username%
echo put Info.txt
echo disconnect
echo bye
) > a.dat
And make sure the batch file does not contain trailing spaces/tabs on the lines with echo
.
Upvotes: 2