FTP and rename the ftp-ed file on local folde

December 22, 2010 at 16:04:20
Specs: Windows XP
Hi,
My requirement is to ftp a file(filea.xls) from my desktop to a unix server and rename the ftp-ed file(filea.xls) present in my desktop, so that I dont resend the file.

Probably this scenario was answered before, but I couldn't fine the thread.


See More: FTP and rename the ftp-ed file on local folde

Report •


#1
December 22, 2010 at 16:51:49
@echo off > ft.do

>> ft.do echo o domain.com
>> ft.do echo username
>> ft.do echo password
>> ft.do echo bin
>> ft.do echo cd mydir
>> ft.do echo put filea.xls
>> ft.do echo bye

ftp -s:ft.do

del ft.do
ren filea.xls fileaold


=====================================
Life is too important to be taken seriously.

M2


Report •

#2
December 23, 2010 at 06:23:26
M2,
Thanks for the code. But this is not working for some reason. I am fairly new to Batch programming. This is what I have as a code.

@echo off >ft.do

> ft.do echo o domain
>> ft.do echo userid
>> ft.do echo psswd
>> ft.do echo prompt off
>> ft.do echo mput filea*.xls
>> ft.do echo bye
ftp -s:ft.do

del ft.do

ren C:\Documents and Settings\user-id\Desktop\filea.xls C:\Documents and Settings\user-id\Desktop\fileold.xls

As soon as the bye command is executed, the control comes out of the batch file and probably doesn't execute the remaining commands.
Any help appreciated. Thanks in Advance


Report •

#3
December 24, 2010 at 06:00:18
[1] C:\Documents and Settings tells us this is not DOS.

[2] Does the mput succeed?

[3] To REN, or do anthing useful with LFNS, you need: ren "C:\Documents and Settings\bla bla" "some more bla"

[4] the control comes out of the batch means what?


=====================================
Life is too important to be taken seriously.

M2


Report •

Related Solutions

#4
December 26, 2010 at 09:48:28
M2,
I am trying it out on my desktop. It's will actually be executed on a NT server.
I have the sample file on my desktop.
The Ren command is not working.
When the "bye" command is executed the log gets created and the Ren command does not work.

Does this help explaining my issue here?

Srishak.


Report •

#5
December 27, 2010 at 08:51:15
"does not work"

Doesn't help. It will almost always give an error if it fails


=====================================
Life is too important to be taken seriously.

M2


Report •


Ask Question