Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

m-sonawane@eisai.co.in

Need to Change file name for some specific files whose starting is same letters

@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\Program Files (x86)\WinSCP\logs\AutoTransfer.log" /ini=nul ^
  /command ^
    "open sftp://serverdetails/ -hostkey=""ssh-rsa 2048 XXXXXXX""" ^
    "lcd E:\DSU\serverdetails\usr\sftpuser\DSU\DATA\OUT" ^
    "cd /EInvoice" ^
    "put -rawtransfersettings[1] FileNameCase=1 Documents_Action_*.* " ^
    "put -rawtransfersettings[1] FileNameCase=0 *.* " ^
    "exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0
(
 echo Success
)
 else
(
 echo Error
)
 
exit /b %WINSCP_RESULT%

I am using above script to move file automatically to Remote directory through WinSCP.
But in local directory there are multiple files which are starting from same letters (Documets).
I want to move some specific files (Documents_Action) to be in upper case while transferring remote directory.
Currently both files are moving in but (Documents_Action) is moving in both type "uppercase" and "no change".

Please help