FTP Batch File Password issue

I have read through a few scripts for simple Unattended FTP scripts that doesn't require additional applications, but I can't seem to get the server that I am logging into to accept the password.

The following script successfully logs into the ftp server & accepts the login, but I can't seem to get it to recognize the password. I am executing this from Windows 2003 Server connecting to a sun64 FTP server if this helps.

BAT File Code:
ftp -s:ftpparams.txt
PAUSE

The ftpparams.txt File Code:
open ftp.dnb.com
user {userID} {password}
cd gets
get {filename}
bye

Note: I replace {password} & {username} with the actual id & password without the brackets.

I have also tried putting the password on the second line (which was a reach). I tried pass {password}, password {password}, /{password}. No luck. Does anyone see a problem or have an idea on what to try? I would like to keep this in a batch file & not have to install 3rd party tools unless it's required. Other people have been able to get this to work. I imagine that I should be able to as well.
Thanks!
JeepGeekinAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
prashsaxCommented:
open ftp.dnb.com
user {userID}
{password}
cd gets
get {filename}
bye

Username and password should not be in same line.
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
prashsaxCommented:
This is how it should look like.
-----------------------------
open 11.11.11.11
user <------------Keyword
guest <------------UserID
guest <------------password
put file1
quit
0
 
JJT2750Commented:
Hello  try this

Open ftp.dnb.com
user=userid
password=userid@dnb.com
put yourfile
bye
0
Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

 
JeepGeekinAuthor Commented:
Thanks for the posts. I have tried all of the recommendations and I get the response "Login failed for userID" (except it does state the correct userID I gave it. The userID seems to be getting through, just not the password....and I hand typed it about 20 times today and know I am using the correct ID & password.

Thanks for the variation JJT2750, but for troubleshooting I wanted to mention that it recognized the userID as "user=userid" (again userid being the actual id that we use). I tried the password the way you have it and tried:

user {username}
{password}@dnb.com

I thought this might work, but I got the same login error mentioned above. Also, just to mention it I can manually perform a successful login using the same login info I am trying to pass it from a command prompt on the same server. That rules out some basic issues.

I'm at a loss. Anyone have any other ideas? Possibly there is a different way to communicate with this type of server?

 
0
 
prashsaxCommented:
You need to type userid and password exactly as you are using with manual FTP command.

All you need to do is to initiate FTP from command prompt manually.

Then, if you are able to login then just use same userid and password.

You can try and create this script for some other FTP site. e.g ftp.cdrom.com

See if it works.

I think it the correct.
0
 
JeepGeekinAuthor Commented:
OK. I tried to run this from a XP Pro box and 2000 box and my initial code worked fine on both.
The culprit is Windows 2003 server. The FTP utility shipped with 2003 Server must take different commands. Command line help doesn't cover the parameters for the password & user ID (other then telling me to put them in a seperate parameter file). I can look it up now that I know the problem, but if anyone knows the code that should be used for 2003 server, please post for others that may read this.
Thanks for your help guys.
0
 
prashsaxCommented:
Hey, this indeed is a news.

Will check it up.

Thanks.
0
 
JeepGeekinAuthor Commented:
OK. I got it working (Microsoft not being a help).

For 2003 server, remove the word "user" for the user ID & add the password to the second line in the parameter file.

The following will work on WINDOWS 2003 SERVER (and also worked on XP). Make sure you don't use the keyword "user" in your parameter file:

BAT FILE CODE:
ftp -s:ftpparams.txt
PAUSE

Parameter File Code:
open ftp.dnb.com
{userID}
{password}
cd gets
get {filename}
bye
0
 
bigcrayonCommented:
Didn't work for me with many unattended batches broken.  Worked for years but now password has trouble being passed in as any of the following;
USER userID password

userID
password

userID
password@ourdomain.com

results
530 Login or password incorrect!
Login failed.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.