Scripting Assistance

Advertisement

WellConnIT
Joined:
Posts:
2
Location:
Sydney

Scripting Assistance

Hi,

I've got two scripting questions.

I've got two folders, Graphics & Swatch ;

I have a remote FTP server that has corresponding folders.
Each Folder has it's own script(to allow the user to upload a single folder rather than both = less time)

Using WinSCP I can successfully connect and upload files ; however:
1. I can't seem to be able to find out how to use the uppercase function of the GUI to change the filenames of all the swatch files to uppercase.

2. Is there a way I can keep the folders up to date without needing to re-transfer files that had already been transferred, like an update function vs a send all??
2a. If there's no function to update only new files, then how would I go about changing the name of the extension only after the file has successfully been uploaded(so that it does not change the name of a file that has failed - currently only uploading *.jpg).

Below is the code I"m using for the graphics:
<code>
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/ini=nul ^
/command ^
"open ftp://UserName:Password@Server/" ^
"lcd C:\Users\Andrew\Documents\Graphics" ^
"cd /Graphics" ^
"put *.jpg" ^
"exit"

@echo off

set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
pause

exit /b %WINSCP_RESULT%

</code>

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,426
Location:
Prague, Czechia

Re: Scripting Assistance

WellConnIT wrote:

1. I can't seem to be able to find out how to use the uppercase function of the GUI to change the filenames of all the swatch files to uppercase.
Use the Interface\CopyParam\FileNameCase raw configuration option:
https://winscp.net/eng/docs/rawconfig

2. Is there a way I can keep the folders up to date without needing to re-transfer files that had already been transferred, like an update function vs a send all??
Use the -neweronly switch of the putcommand:
https://winscp.net/eng/docs/scriptcommand_put

Or the synchronize remote command:
https://winscp.net/eng/docs/scriptcommand_synchronize

Reply with quote

WellConnIT
Joined:
Posts:
2
Location:
Sydney

Thank you very much for your assistance both of those solutions worked perfectly.

I'm now looking for a cmd line tool that I can use to compress images on the fly, so if anyone knows of one that compresses JPG images well that'd be great.

Thanks again.

Reply with quote

Advertisement

You can post new topics in this forum