Mike Q
Mike Q

Reputation: 7357

Close WinSCP window opened by a PowerShell script when finished

I wrote a script that loops over a folder and converts files using WinSCP

WinSCP.exe /keygen $filePath /output=$filePathdest

The script works but leaves several WinSCP windows open stating what it completed it's task. I would like to suppress this or force PowerShell to close all of its children when finished. Is this possible?

Upvotes: 1

Views: 231

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202721

Use winscp.com instead of winscp.exe.

winscp.com /keygen $filePath /output=$filePathdest

The winscp.com is a console application with the same functionality as winscp.exe. Being a console application it inherits the console from PowerShell and does not open its own. It also does not wait for key press when done.

Upvotes: 1

Related Questions