Solved

FTP Batch File Password issue

Posted on 2006-06-13
9
1,311 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
ID: 16894699
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
ID: 16894715
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
ID: 16895782
Hello  try this

Open ftp.dnb.com
user=userid
password=userid@dnb.com
put yourfile
bye
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:JeepGeekin
ID: 16896437
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
 
LVL 13

Expert Comment

by:prashsax
ID: 16896624
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
ID: 16896719
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
ID: 16896843
Hey, this indeed is a news.

Will check it up.

Thanks.
0
 

Author Comment

by:JeepGeekin
ID: 16896867
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
ID: 37703238
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Multiple times a day Computer loses internet connection 17 87
EIGRP STUB 19 72
md5 password 3 62
How to Create Separate Guest WiFi VLAN on Netgear R8000 19 56
Let’s list some of the technologies that enable smooth teleworking. 
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
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…

777 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