1

I am using WinSCP with PuTTY and I have setup an auto login to PuTTY from WinSCP. I have a bat file that opens the WinSCP and several connections to remote machines and once the WinSCP connects it also automatically opens the PuTTY.

What I want is to send command top to the PuTTY after login. Is there any way to do it ?

I am monitoring several Linux servers. I want that after the PC starts up, it automatically opens PuTTY console with and send a top command.

1 Answer 1

1

In the WinSCP preferences go to the Integration > Applications page.

There specify the following command in the PuTTY/Terminal client path box:

"%PROGRAMFILES%\PuTTY\putty.exe" -t -m "%TEMP%\putty.txt" !`cmd.exe /c echo top > "%TEMP%\putty.txt"`

It follows the same approach as suggested for opening PuTTY in the same directory in WinSCP documentation. Just instead of the cd command, use the top. For details see the link.

2
  • Well, but there is one problem, later if I want to start up another season of putty for something different than watching top I cannot leave the top because once I do ctrl+c the session and entire putty windows is closed.
    – Dakado
    Commented Mar 15, 2016 at 20:54
  • Replace the top with top ; /bin/bash to start a bash shell after you terminate the top. Commented Mar 16, 2016 at 6:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .