Using saved connections / transfer Profiles

Advertisement

Learza
Joined:
Posts:
1

Using saved connections / transfer Profiles

Hi,

I am new to WinSCP (and new to administration). Therefore, I lack good skills in batch scripting. Also, we won't be using WinSCP a lot, so my time spent on this topic should be limited.

I got it running, but only if I spell out the password in the batch file. I hoped to define the connection and the transfer profiles in the GUI and call this saved information within the batch file. That way, I could keep track and update later in the GUI and won't have to bother about updating all scripts. Also, I know for sure where the passwords are saved.

However, this is the current working file (file/connection/Mask Data replaced):
"C:\Program Files (x86)\WinSCP\WinSCP.exe" /ini=nul /log="C:logFolder\batch.log" /command ^
    "open sftp://Username:Password@remoteServer/ -hostkey=""ssh-rsa KEY""" ^
    "synchronize local -filemask=""MyMask"" ""destinationFolder"" ""sourceFolder""" ^
    "exit"
pause
I would like to define TestConnection and Testprofile in the GUI and have the Batch File as
"C:\Program Files (x86)\WinSCP\WinSCP.exe" /ini=nul /log="C:logFolder\batch.log" /command ^
    "open TestConnection ^
    "synchronize local -filemask=Testprofile ""destinationFolder"" ""sourceFolder""" ^
    "exit"
pause
Note: the first script is working. The set-up connection and profile are working also. So it seems to be my understanding in how to handle the batch file which keeps me from success.

The second script (and variants I tried) fail at loading the connection (seem to be taking TestConnection as the URL and tries to connect, so fails for sure).

Best regards,
Learza

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum