?
Solved

Batch to get file thru FTP

Posted on 2010-03-27
16
Medium Priority
?
531 Views
Last Modified: 2012-05-09
Hello ,
 i was have windows 2000 windows batch and its worked file after i upgrade the system from 2000 to XP i have problem with this batch , now my problem is ,

when i run the batch from XP and put wrong password the batch create the file in my local disk even the password wrong , but it 2000 it give me the password wrong

see the attahced batch and whats the problem with it

i have 3 file

1- get.ftp
2-get.bat
3-get.out


GET.FTP Attahced
GET.BAT Below

echo del C:\FTP\get.out
echo cd c:\ftp
ftp -v -n < c:\ftp\get.ftp > C:\FTP\get.out
exit




o 192.168.1.1
USER user1
PASSWORD 
ascii
lcd C:\FTP
cd \user1\file
get FILE4 file.txt
delete FILE4
delete file4back
quit

Open in new window

0
Comment
Question by:palddl
  • 5
  • 4
  • 4
  • +1
14 Comments
 
LVL 15

Expert Comment

by:DonConsolio
ID: 28792794
> ftp -v -n < c:\ftp\get.ftp > C:\FTP\get.out

try this:
ftp -v -n -s:c:\ftp\get.ftp > C:\FTP\get.out
0
 
LVL 1

Author Comment

by:palddl
ID: 28824799
not working any other solution ?
0
 
LVL 60

Expert Comment

by:Bill Prew
ID: 28826683
What shows up in the get.out file?

~bp
0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
LVL 16

Accepted Solution

by:
t0t0 earned 2000 total points
ID: 28871886
Try this (change the username and password to your own):



@ECHO OFF
(
   ECHO username
   ECHO password
   ECHO ASCII
   ECHO LCD c:\ftp
   ECHO CD \user1\file
   ECHO GET file4
   ECHO DELETE file4
   ECHO GET file.txt
   ECHO DELETE file4back
   ECHO BYE
)>script.txt

FTP -s:script.txt 192.168.1.1




NOTE: Is this correct:

   ECHO GET file.txt
   ECHO DELETE file4back

or did you mean:

   ECHO GET file.txt
   ECHO DELETE file.txt

or even:

   ECHO GET file4back
   ECHO DELETE file4back
0
 
LVL 1

Author Comment

by:palddl
ID: 28971095
no solution was fix this problem
0
 
LVL 60

Expert Comment

by:Bill Prew
ID: 28973118
I'm still waiting for your reply to my earlier question of:

==> What shows up in the get.out file?

~bp
0
 
LVL 1

Author Comment

by:palddl
ID: 30700408
invalid user name and password , also it creatre the file.txt
0
 
LVL 60

Expert Comment

by:Bill Prew
ID: 30747467
Could you post the full contents of the get.out file please.

~bp
0
 
LVL 60

Expert Comment

by:Bill Prew
ID: 32351418
Would have liked to help further, but my request for a post of the log file was not responded to.

~bp
0
 
LVL 16

Expert Comment

by:t0t0
ID: 32353117

>>"invalid user name and password , also it creatre the file.txt"

have you checked the username and password are correct? try them by manually logging onto the remote server.

i can't see anything in any of the code above that causes the creation of the 'file.txt' - apart from a successful download of course.

please be more responsive to questions. both billprew and i have asked you to confirm something or another and you have failed to do so.
0
 
LVL 16

Expert Comment

by:t0t0
ID: 32353119
furthermore, i have every reason to believe the structure of my code in comment ID 28871886 would work 100%. please confirm.
0
 
LVL 1

Author Comment

by:palddl
ID: 33000512
Hello,

the t0t0 solution doesnt help me , still i have this problem and didnt get full solution.
0
 
LVL 16

Expert Comment

by:t0t0
ID: 33001796
I am  quite happy to assist you further.

At the end of the day, you have brought a question to EE which is not resolved.

I ask you to cooperate by responding if or when asked to do so.

0
 
LVL 1

Author Comment

by:palddl
ID: 33044184
the problem i cant test this until have the same procedure , i do it once amonth , so we should wait , also i want to remove the block that i got it from you ,.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
In a question here at Experts Exchange, a member was looking for "a little app that would allow sound to be turned OFF and ON by simply clicking on an icon in the system tray". This article shows how to achieve that, as well as providing the same OF…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Watch the video to learn how one can deal with PST file corruption issue with an outstanding Kernel for Outlook PST Repair Tool easily. Using this tool, non-technical users can swiftly perform the repair process to restore their essential data witho…
Suggested Courses

593 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