Operating System - HP-UX
1823143 Members
3442 Online
109647 Solutions
New Discussion юеВ

Re: Ftp batch file to transfer file to Unix

 
Nick D'Angelo
Super Advisor

Ftp batch file to transfer file to Unix

Admins,

I am looking for an ftp.bat file that will prompt the user for a file name, look in a specific directory on their PC and then automagically ftp it to the Unix server without them entering the ftp account and password.

I would like to then make this into an exe file so that they login credentials are not exposed and put it on their desktop.

Any suggestions, thanks.


Always learning
5 REPLIES 5
Vijeesh CTK
Trusted Contributor

Re: Ftp batch file to transfer file to Unix

Ian Dennison_1
Honored Contributor

Re: Ftp batch file to transfer file to Unix

If you wish to do this in a .bat file on DOS, the option 'ftp -s:filename' is used to specify a file of commands.

If you wish to go further and create an executable, break out a development package. Alternatively, make the 'ftp' anonymous or perform a 'chroot' upon login to protect the files.

Share and Enjoy! Ian
Building a dumber user
Nick D'Angelo
Super Advisor

Re: Ftp batch file to transfer file to Unix

That is a good start, but how can I build in the prompt for the file name that will change every week?
Always learning
Ian Dennison_1
Honored Contributor

Re: Ftp batch file to transfer file to Unix

Write a DOS Batch file that will prompt for the data, build the commands text file, then run the ftp command with the text file that was built.

Its been 10 yrs since I wrote a DOS Batch file with any form of input and logic. Try asking someone over 35 in your IT organisation, they may know how.

Share and Enjoy! Ian
Building a dumber user
Ron Kinner
Honored Contributor

Re: Ftp batch file to transfer file to Unix

To simplify things you could do what our production system does. The transfer process runs as a service. It periodically checks a folder - let's call it OUT - and if it find something it opens an FTP session and away it goes.

All the user has to know is that anything placed in the OUT folder will be sent to the other server. You can then just use explorer to move the file into OUT or you can write a bat file which does a mv * OUT if you prefer DOS.

There is a commercial program ($40) called robo-ftp which might do what you want.

http://www.winsite.com/bin/Info?5000000038404

To download a demo/trial version.

Ron