Please help.......Problem in FTPing

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Kunal
Posts: 6
Joined: 01 Dec 2011 04:37

Please help.......Problem in FTPing

#1 Post by Kunal » 01 Dec 2011 04:48

Dear Gurus,

I did try a lot options to get certain files in conventional DOS way but FTP couldn't recognize the pasword everytime. Cna anyone assist me , where it's going wrong?

One method
I have text file as FTPget.txt as below

Code: Select all

user username
password
bin
cd /analytics/extracts/lcd P:\Data
get cvagui.zip
bye


and I'm calling this thru a bat file as below

Code: Select all

c:\Program Files\Support Tools>ftp -d -n  -s:P:\batch\Main_Tasks\FTPget.txt XX.XX.XX.XX
Connected to XX.XX.XX.XX.
220 Microsoft FTP Service
ftp> user username
---> USER username
331 Password required for username.

---> PASS password
530 User username cannot log in.
Login failed.
ftp> bin
---> TYPE I
530 Please login with USER and PASS.
ftp> cd /analytics/extracts/
---> CWD /analytics/extracts/
530 Please login with USER and PASS.
ftp> lcd P:\Data
Local directory now P:\Data.
ftp> get cvagui.zip
---> PORT 10,59,139,214,13,155
530 Please login with USER and PASS.
---> RETR cvagui.zip
530 Please login with USER and PASS.
ftp> bye
---> QUIT
221

So in this part I have problem that it can't recognize the password listed in the file?

method 2

I took it from this form , filename called as FTPlogin.bat

Code: Select all

@ftp -i -s:"%~f0"&GOTO:EOF
open XX.XX.XX.XX
UID
Password
pwd


Now if I run this batch ;still same prompt popping up that It need password I don't don't know where I'm doing wrong.

ftp> @ftp -i -s:"%~f0"&GOTO:EOF
Invalid command.
ftp> open xx.xx.xx.xx
Connected to xx.xx.xx.xx
220 Microsoft FTP Service
User (xx.xx.xx.xx:(none)):
331 Password required for uid .

530 User uid cannot log in.
Login failed.
ftp> pwd
530 Please login with USER and PASS.
ftp> lcd
Local directory now P:\batch\Main_Tasks.
ftp> pwd
530 Please login with USER and PASS.
ftp>

If I'm trying thru commandprompt ftp works like a charm,but have no clue where I'm doing it wrong. can anyone please help me.

Post Reply