Command line for moving files to another folder (ver. 5.19.2 on Windows OS)

Advertisement

Ola
Joined:
Posts:
2

Command line for moving files to another folder (ver. 5.19.2 on Windows OS)

Hello!
I am a new user of WinSCP. And now I need help for moving files. Here is my batch-file now:
"C:\Program Files\WinSCP\WinSCP.com" ^
  /log="C:\WinKboUtsending\WinScpLog\WinSCP.log" /ini=nul ^
  /command ^
    "open sftp://USERNAME:Hb.592-XXXXX@ADRESS/ -hostkey=""ssh-ed25519 256 HT7IB76+WWRiFuCwsl0HznfdI9kfGkk16HQtMY1ndoY=""" ^
    "get -delete /out/*.xml C:\WinKboUtsending\Import\" 
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
exit /b %WINSCP_RESULT%
I want to move (not only copy!) files from C:\WinKboUtsending\Import\ and to
C:\WinKboUtsending\Import\ANOTHER FOLDER

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Command line for moving files to another folder (ver. 5.19.2 on Windows OS)

I do not understand. Which files do you want to move? The downloaded files? So why don't you download them straight to C:\WinKboUtsending\Import\ANOTHER FOLDER?

Reply with quote

Ola
Joined:
Posts:
2

Re: Command line for moving files to another folder (ver. 5.19.2 on Windows OS)

Hi!
XML-files are downloading to /OUT/ every hour.
I download them to my local C:\WinKboUtsending\Import\

But I want to move the files also to another folder f ex under /OUT/

After copying and moving, the files will be deleted in the folder /OUT

Was this better to understand? Thanks for helping me! :)

Reply with quote E-mail

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Command line for moving files to another folder (ver. 5.19.2 on Windows OS)

Before you wrote that you want to move the files to C:\WinKboUtsending\Import\ANOTHER FOLDER, what is local path. Now you wrote "under /OUT/" – what is probably a remote path. So no, your question is still not clear.

Is this what you are after?
https://winscp.net/forum/viewtopic.php?t=28792

Reply with quote

Advertisement

You can post new topics in this forum