Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Downloading a File from UNIX to my Windows PC

Status
Not open for further replies.

Frankr100

ISP
Jul 11, 2003
4
US
Hoping someone might be able to give me some direction. I have a task to grab a file from a UNIX folder and copy it down to my Windows2k PC. Now, I have accomplished this manually, from the command line, by using FTP to connect to the UNIX server, entering in a UserID and Password, and then using the GET command to grap the file and it ends up in the Root directory of my C: drive.

Can't seem to automate this with a Batch file, will only connnect to the UNIX server and stops at the login. So I am assuming that UNIX will not accept the text from the BAT file. Can someone give me an idea how I can accomplish this task. It seemed so easy when I did it manually, but I am not a UNIX programmer, so I am lost.

TIA

-=Frank=-
 
Have you tried to use the -s option of your ftp client ?
To get help with ftp, type ftp -? in your console (command line) window.

Hope This Help
PH.
 
Create a file like this:

open <ftphostname or IP>
<username>
<password>
<commands>
bye

and then

ftp -s:<filename with path>
 
I can not thank you enough. That worked!!

One more question if you can, I am getting the file to copy down into the same folder as the BAT is in, I have to get four different files from the UNIX server. Anyway, I can't seem to direct the download to another folder other than the one the BAT file is in??

Thanks so much!!

-=Frank=-
 
You have to play with lcd
To see all the commands available, start a ftp session, and type ? on the ftp> prompt.

Hope This Help
PH.
 
An example:

In a file called test.txt:

open myhost.com
comtec17
password
lcd C:\mydir\puthere
cd /home/comtec17
get myfile.txt
bye

Now in a .bat file

@ECHO OFF
ftp -s:C:\test.txt

 
You guys have been just great. Thank you so much for your help, I really struggled with this for days. I now have it working perfectly, and should have my project done by next week...... half a month a head of schedule!!

Thanks again to you PH and to you COMTEC.......

-=Frank=-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top