Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

FTP Batch File Password issue

Posted on 2006-06-13
9
Medium Priority
?
1,336 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 13

Accepted Solution

by:
prashsax earned 2000 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
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
Make the most of your online learning experience.
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

650 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