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

martin

Re: Call WinSCP Saved Session

Yes, see:
https://winscp.net/eng/docs/commandline#scripting
https://winscp.net/eng/docs/guide_automation

Though, it's not recommended to rely on GUI configuration:
https://winscp.net/eng/docs/scripting#configuration

You can have WinSCP GUI generate a full script for you:
https://winscp.net/eng/docs/ui_generateurl#script

Though in PowerShell, it's better to use WinSCP .NET assembly:
https://winscp.net/eng/docs/library_powershell
https://winscp.net/eng/docs/ui_generateurl#code
tee1

Call WinSCP Saved Session

Is there a way to call the WinSSP saved session and not have WinSCP launch in the foreground. I have a PowerShell script that currently makes a SFTP call to a site; however, I'm needing to use a proxy now. So, I thought that the easiest way would be to create a session in WinSCP then call that saved session from my script. My call line is a
Start-Process -FilePath "C:\Program Files...\..\WinSCP.exe" -ArgumentList "SiteName" -Wait -NoWindow

What this does is launch the WinSCP GUI, logged me into the site, and then stopped. Is there a command switch to run a batch file? My previous process was running psftp and I had the command line arguments for the batch file. Can WinSCP take parameters to run a batch file?