Running application from command line using vb.net
I have a problem when trying to run a .sh file when using vb.net to write to command line.
I put the
xxxx.sh
file in the root of the server but I am unable to run it, here is the code...
winscp.StandardInput.WriteLine("option batch abort") winscp.StandardInput.WriteLine("option confirm off") winscp.StandardInput.WriteLine("open sftp://10.129.8.126:22") winscp.StandardInput.WriteLine("user") winscp.StandardInput.WriteLine("password") winscp.StandardInput.WriteLine("ls") winscp.StandardInput.WriteLine("cd /") winscp.StandardInput.WriteLine("put c:\directory\example.sh") System.Threading.Thread.Sleep(10000) winscp.StandardInput.WriteLine("chmod 777 uc3_log.sh") winscp.StandardInput.WriteLine("/console ./example.sh")
If I enter
./example.sh
from the console within WinSCP it works fine.
Any ideas how I can do this?
Cheers