Question: i am trying to write a bat file on windows xp. I can connect ftp server and download files by console but i can't make it work by unattended bat file.

ftp 127.0.0.1 //connect server but ask username and password manualy how can i connect autamticly with password ? 

i have tried ftp 127.0.0.1 pass pass but doesn't work. [all commands here](http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ftp.mspx?mfr=true)

Answer: 
Save this as a batch file and run it

```
echo user  >> ftpcommands.txt
echo myusername>> ftpcommands.txt
echo mypassword>> ftpcommands.txt
echo get file1>> ftpcommands.txt
echo get file2>> ftpcommands.txt
echo quit  >> ftpcommands.txt
ftp -n -s:ftpcommands.txt ftp.example.com
del ftpcommands.txt

```
Best solution is write commands into text file then send that text file as parameter.

```
echo user nod32 nod32 >ftp.txt

echo get my.text d:\my.txt >> ftp.txt

echo cd Books >>ftp.txt

ftp -n -s:ftp.txt localhost

```