Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Levievre

Hello Martin,

This does not make sense. How can this help?


I don't know how this can help. I just applied your advice described in this topic :

https://winscp.net/forum/viewtopic.php?t=13708

You are missing a slash. Use c:\rename.txt.


With a slash, it does not work better

Levievre
martin

Re: ftp to winscp script conversion problem

I added an ls command between put and exit and then it works.

This does not make sense. How can this help?

get -transfer=ascii myfile.txt c:rename.txt

You are missing a slash. Use c:\rename.txt.
jrp78

I was thinking you would put both winscp.com and the other commands all in one batch file. That's how I run my winscp.com script with other dos commands after that fact.
Levievre

I was thinking about this solution. i can create a batch file to delete the newname.txt file if already exists then renaming the uploaded file to newname.txt.

Since I have to execute first Winscp.com then launch the batch file, this is a long path when comparing this solution with my original microsoft ftp command.
Guest

Ahh, I'm not sure on renaming local. However, I will say if you are using windows batch file to call the script in the first place, why not just use the DOS ren command right after the script is done?

winscp.com /script=myscript.txt /ini=nul /log=mylogfile.txt
cd filedirectory
ren myfile.txt newname.txt
Levievre

Jrp78,

I need to upload a file with a new name in my local directory but I don't want to rename the file in the remote directory.

Do you think I can use the mv command for this purpose ?
Levievre

I have no errors in the log file.

I did some searches and found a solution in a another topic :

I added an ls command between put and exit and then it works.

But I have another problem. I can't convert this command to winscp correctly :

get -transfer=ascii myfile.txt c:rename.txt

It works but I get myfile.txt in my local directory instead of rename.txt

Thank you for tour help.
JeroenE

What happens? Do you get errors? What does it say in your logfile?
Levievre

ftp to winscp script conversion problem

Hello,

I would like to subsitute microsoft ftp with winscp but can't achieve to put a file on a server.


Here is myscript.txt file :

open ftp://username:password@ftp.example.com/
cd /archive
put -transfer=ascii myfile.txt
exit

I use a computer under windows XP, launch cmd.exe and then type the following command :
winscp.com /script=myscript.txt /ini=nul /log=mylogfile.txt

Could you tell me what is wrong with my script ?

Thank you,
Levievre from France.