Topic "Can I run the "open" command such that the window is not visible?"

Author Message
cag8f
[View user's profile]

Joined: 2014-06-25
Posts: 9
Hi all. I'm just getting started with WinSCP scripting, and have a question about the open command. When I run this command, it opens a visible WinSCP.com window. But is it possible to run this command such that the WinSCP.com window is not visible? I'd like to run a small script in the background that does not interfere/distract the user. The script downloads a small file via SFTP.

If this is not possible with open, might there be another approach I could take to achieve what I want?

Thanks in advance.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25946
Location: Prague, Czechia
The open does not open any window. It's mere starting of the winscp.com that causes Windows to create a console window (as the winscp.com is a console application).

If you do not want the console window, use the winscp.exe instead:
https://winscp.net/eng/docs/executables
_________________
Martin Prikryl
cag8f
[View user's profile]

Joined: 2014-06-25
Posts: 9
Ah of course, my mistake.
Code:
open
is used to open an SFTP connection. It is the statement in my BAT file:

Code:
"C:\Program Files (x86)\WinSCP\winscp.com" /script=htaccess-script.txt


that needs to be edited (if possible) so that winscp.com runs in the background. Any ideas how to do that off the top of your head?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25946
Location: Prague, Czechia
Once again:
If you do not want the console window, use the winscp.exe instead:
https://winscp.net/eng/docs/executables
_________________
Martin Prikryl
cag8f
[View user's profile]

Joined: 2014-06-25
Posts: 9
Whoops, sorry--I thought that line was part of your signature. Changing to winscp.exe improves it, but this time a Windows command prompt window is open during the process, instead of winscp.com. No worries, I think I can live with it or re-visit it if it becomes an issue. I read in another forum that if I schedule a Windows Task to run the BAT file on a regular basis, a window will not appear--I'll test that.

Thanks for the help.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25946
Location: Prague, Czechia
cag8f wrote:
Changing to winscp.exe improves it, but this time a Windows command prompt window is open during the process, instead of winscp.com.

But that has nothing to do with WinSCP.
Does your batch file do anything else apart from running WinSCP?
If not, skip the batch file and run WinSCP directly.
Otherwise, see https://superuser.com/q/62525/213663
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License