0

Is there a way Ii can open WinSCP Command window/Open Terminal (Ctrl + T) window directly and pass du command to it through code/scripts.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992

1 Answers1

0

To automate this operation, use the call scripting command:

call du

A complete Windows batch file would be like:

winscp.com /command ^
    "open sftp://username:password@example.com/" ^
    "call du" ^
    "exit"

Though note that WinSCP is a file transfer application. While WinSCP can execute shell commands, using a terminal application to execute commands is more natural.

For example with PuTTY Plink, you can do:

plink.exe -ssh username@example.com du
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992