Forum Discussion

ssa's avatar
ssa
Occasional Contributor
10 years ago

How to execute SCP and SSH commands from TC.


Hi Team,



I am trying to Prepare Environment to automate a test and for that i need to run "scp" and "ssh" command from TC.



Note: After doing ssh i also need to execute some other commands on that linux box(SLES).



Currently i am doing it manually from cygwin. Not sure how can i do from TC.



Followed this article 



http://support.smartbear.com/viewarticle/62782/



Tried like below



var p, w; 


p = Sys.Process("C:\\cygwin64\\bin\\mintty.exe");


w = p.Window("ConsoleWindowClass", "*");


Getting this Error message.



The process "C:\cygwin64\bin\mintty.exe" was not found.



Any idea or pointer how can i do this?


2 Replies

  • ssa's avatar
    ssa
    Occasional Contributor


    Alexei Karas thanks for you post.



    I've installed openSSH in my system (win7) and able to do ssh like below...



    new ActiveXObject("WScript.Shell").Run("C:/cygwin64/bin/ssh ardome@HOST");



    but unable to do scp in the same way..



    new ActiveXObject("WScript.Shell").Run("C:/cygwin64/bin/scp FILE USER@HOST:");



    Followed the shared tharead and tried like below but in this case ssh and scp nothing works.



    Sys.OleObject("WScript.Shell").Exec("C:\\cygwin64\\bin\\ssh.exe USER@HOST");



    Sys.OleObject("WScript.Shell").Exec("C:\\cygwin64\\bin\\scp.exe FILE USER@HOST:");



    Any idea what might possibley be gone wrong?