Solved

FTP Batch File Password issue

Posted on 2006-06-13
9
1,298 Views
Last Modified: 2013-11-29
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!
0
Comment
Question by:JeepGeekin
9 Comments
 
LVL 13

Accepted Solution

by:
prashsax earned 500 total points
Comment Utility
open ftp.dnb.com
user {userID}
{password}
cd gets
get {filename}
bye

Username and password should not be in same line.
0
 
LVL 13

Expert Comment

by:prashsax
Comment Utility
This is how it should look like.
-----------------------------
open 11.11.11.11
user <------------Keyword
guest <------------UserID
guest <------------password
put file1
quit
0
 
LVL 3

Expert Comment

by:JJT2750
Comment Utility
Hello  try this

Open ftp.dnb.com
user=userid
password=userid@dnb.com
put yourfile
bye
0
 

Author Comment

by:JeepGeekin
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 13

Expert Comment

by:prashsax
Comment Utility
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
 

Author Comment

by:JeepGeekin
Comment Utility
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
 
LVL 13

Expert Comment

by:prashsax
Comment Utility
Hey, this indeed is a news.

Will check it up.

Thanks.
0
 

Author Comment

by:JeepGeekin
Comment Utility
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
 

Expert Comment

by:bigcrayon
Comment Utility
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

Featured Post

Free camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

Join & Write a Comment

#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now