How To Run a Script in WinSCP

14,725

Solution 1

Try this sh "!"

OR

First of all executing commands from WinSCP can be tricky and if you are able to run few commands also,there are restrictions which you can not do fro WinSCP and should have to ultimately take help of PUTTY.

Here is the link Integrate WinSCP with Putty which will help you integrate your WinSCP to Putty,so that when you open any server through WinSCP putty will automatically connect without even asking for the password.And then you can run you command,hope that wound be of any trouble to you.

Remember you can store the connection details in WinSCP and in just one click it will connect to the server on SCP and also on Putty.

Solution 2

You can define your own custom command by right-clicking, selecting Custom commands and selecting Customize. Then click "Add", enter a description, e.g. Run and specifying a custom command. Try sh "!" to start with - that works ok for me, if you still get errors post your output back here. The quotes are important - only the exclamation should be quoted.

Share:
14,725
user3930361
Author by

user3930361

Updated on June 26, 2022

Comments

  • user3930361
    user3930361 over 1 year

    I am using winSCP GUI to connect to linux terminal and then copy the files and other stuff.

    Now i have some scripts on the UNIX server,I am connected but how to run the script from the Win SCP.

    what basically is needed is sh scriptname.sh through the WinSCP.Please let me know if anyone else found out how to do that.AS loging into putty and running the command is time taking for me. WinSCP Custom Command option tried to click on Execute,but the error pops up like no such directory.

    Tried google but to the point information is not coming up.