I have the following script to automate uploading a file to a remote server.
The problem is that the password I have been given is full of special characters which are killing the login process.
Here is a changed version of the characters.
j7~]%&X
When using a normal ftp app there isn't a problem. I have wrapped the password in quotes and have also tried using a ^ to escape the percentage and ampersand. However, it doesn't work. Also, I can't tell what the actual password is that is being sent.
Any tips on what could be going wrong or how to reveal the password before it is sent?
:Source = http://www.howtogeek.com/howto/windows/how-to-automate-ftp-uploads-from-the-windows-command-line/
@echo off
echo user myloginname> ftpcmd.dat
echo mypassword>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo put %1>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat myserver
del ftpcmd.dat
SOLUTION
As mentioned below, I used the "type" command to see what was actually in the ftpcmd.dat. It turns out that, through a lot of trial an error and reading up on escape characters that you use different escape characters for different special characters!!!
For an ampersand use a caret, and for the percentage use a percentage. So, given my password:
j7~]%&X
the resulting password would be:
j7~]%%^&X