General discussion

Locked

FTP Script file

By Daygo_171 ·
I am trying to automate an FTP transfer using a batch file in win xp. I am having trouble getting my batch file to run the script (which is a .txt file) to automatically log into the FTP server, transfer the files, then quit.

I see that I need to use the following sequence:

-s:filename

in my batch file to run the script. Problem is my batch file cannot find the script file. How do I make the connection?

This conversation is currently closed to new comments.

10 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Use the batch file....

by LiamE In reply to FTP Script file

Use the batch file to set the current directory to the location of the script.

E.G. Script file is call script.txt and located in the root of c:

The Batch file would contain something lines like...
c:
cd\
ftp -s:script.txt ftp.ftpsite.com

Collapse -

How will i create batch file

by ramanaiahm In reply to Use the batch file....

Hi How did you came across this situation finall..i am in same problem could u please explain me how can i create a batch file that will call text file for uploading file into the otherer server.

Collapse -

creating a file

by gppadu In reply to How will i create batch f ...

At first u need to create a batch file by using command copycon in dos mode \by storing the file with extension .bat.

Collapse -

Queries from India

by jim.marshall In reply to How will i create batch f ...

Yes it would be GREAT to share knowledge with you guys from India so that next week our jobs can be outsourced to you.

RTFM and work it out for yourself.

Collapse -

Regarding FTP Script file

by gppadu In reply to FTP Script file

give your path(i.e.stored directory) of script file in batch files .then run the Batch file with additional options if necessary

Collapse -

How can I add a log file

by ramanaiahm In reply to Regarding FTP Script file

Hi,
Please help me out ...
I need to add a log file to the script file so that I can log the status of file after trasfering using FTP.
Since i am novice to this scripts i am asking.
Thanks

Collapse -

ADDING LOG FILE

by jphillips In reply to How can I add a log file

In case you are still looking - Store date/time and then script response.

date /t >> upload_log.txt
time /t >> upload_log.txt
ftp -s:"ftp.scr" >> upload_log.txt

the >> tells it to append
Use > to create a new file

Collapse -

Use the scr extension

by Ziskey In reply to FTP Script file

You can use the following syntax within a batch file to call the ftp script. For example, you can run a file called getftp.cmd

Within the file you have a line such as

ftp -s:c:\ftp\getfile.scr > c:\ftplog.txt

The "> c:\ftplog.txt" at the end creates a logfile.

The getfile.scr is a script that opens an ftp session and logs in. Just be aware that the password is saved as plain text. The getfile.scr script might look something like this...

open servername
username
password
ascii
get file.txt
quit

You can use any scheduler to call the cmd file.

Collapse -

Try this

by eldorel In reply to FTP Script file

@echo off

echo Username>> c:\ftp.txt
echo Password>> c:\ftp.txt
echo ascii>> c:\ftp.txt
echo hash>> c:\ftp.txt
echo prompt>> c:\ftp.txt
echo mget *.txt>> c:\ftp.txt
echo bye>> c:\ftp.txt

@echo on

ftp -s:c:\ftp.txt ftp.example.org
dir

del c:\ftp.txt


REM Remeber to replace Username and Password and ftp.example.org with the correct values for your server...

Collapse -

ftpshell script for rollover log file

by kettavanking In reply to FTP Script file

i'm stuck with the ftpshell script for rollover log file with max size of 20480 bytes. here is my script.
ftpshell -script "backup.fscr" -tslogfile "test.log" -append 20480

i tried to run it, but it is not running. anyone please help me. my advance thanks.

Back to IT Employment Forum
10 total posts (Page 1 of 1)  

Related Discussions

Related Forums