Computing.Net > Forums > Programming > Batch Script To FTP a file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch Script To FTP a file

Reply to Message Icon

Name: ksuchetan
Date: September 23, 2008 at 14:30:12 Pacific
OS: Windows XP
CPU/Ram: 2 gb
Product: not known
Comment:

Hi,

I want to ftp a file from windows to unix server can we do it with a batch script if yes let me know

I tried this piece of action

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\comp>

cd c:\temp

ftp <host name>
Connected to <host name>
220 <host name> FTP server (Version x.x Tue sept 22 21:20:07 CDT 2008) ready.
User (<host name>:(none)): your_userid
331 Password required for your_userid.
Password:
230 User your_userid logged in.

ftp>pwd
/home
ftp> cd /temp/filefolder
ftp>pwd
/temp/filefolder
ftp> put test2.txt test1.txt

I am getting the following error

200 Port command successful
553 test1.txt :permission denied.

Please help me in making this process as batch script and what is exactly teh error.

Thanks
In Advance

Thanks In Advance



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: September 23, 2008 at 16:24:06 Pacific
Reply:

553 test1.txt :permission denied.

The account you're using on the UNIX side doesn't have the file permissions to add test1.txt.


0

Response Number 2
Name: Mechanix2Go
Date: September 24, 2008 at 08:14:18 Pacific
Reply:

Once you get permission:

=================================
@echo off
setLocal EnableDelayedExpansion

> #.ftp echo o mysite.com
>> #.ftp echo username
>> #.ftp echo password
>> #.ftp echo cd /files
>> #.ftp echo put test2.txt test1.txt
>> #.ftp echo bye

ftp -s:#.ftp


=====================================
If at first you don't succeed, you're about average.

M2


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch Script To FTP a file

Shell script to copy a file from local drive www.computing.net/answers/programming/shell-script-to-copy-a-file-from-local-drive-/18791.html

batch script to upload to ftp www.computing.net/answers/programming/batch-script-to-upload-to-ftp/16987.html

batch script to pick thelatest file www.computing.net/answers/programming/batch-script-to-pick-thelatest-file/16427.html