Open file on server in external editor via WinSCP CLI

Advertisement

roofwoof
Joined:
Posts:
4

Open file on server in external editor via WinSCP CLI

Hello!
I have two files on server (SSH-connection). I'm usually open WinSCP GUI-client and open them in Brackets. I configured the Editor preference table in such way that WinSCP opens HTML, CSS and JS files via Brackets. Now I want to automatize this actions using batch or PowerShell script. I want to open WinSCP GUI and open two files in Brackets via batch script. So I wrote the batch-code below:
start winscp.exe <session_name>
winscp.exe <session_name> /edit <path>/my_styles.css
winscp.exe <session_name> /edit <path>/my_script.js
But WinSCP opens these files via internal editor. How can I configure the editor in CLI?

Reply with quote

Advertisement

roofwoof

Re: Open file on server in external editor via WinSCP CLI

When you use WinSCP GUI and open the file WinSCP saves it to temporary directory, then runs external editor to open this file.
Why can't it be implemented in CLI?

Reply with quote

martin
Site Admin
martin avatar

Re: Open file on server in external editor via WinSCP CLI

When you open the editor in GUI, you control, when the connection is closed by the WinSCP GUI.
But if you open an external editor from commandline, there won't be any WinSCP GUI. How would you tell WinSCP to close the connection?

Reply with quote

roofwoof

Re: Open file on server in external editor via WinSCP CLI

Okay, I understood the problem. Maybe it is possible to run session in command line or just run the GUI and open files in its session? I understand that it is a bit complicated to implement.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: Open file on server in external editor via WinSCP CLI

Thanks for your suggestions. We will see, if more people ask for this.

Reply with quote

Advertisement

You can post new topics in this forum