I am newbie for calling scripts from Java through the SFTP connection.
So far, I managed to find the code snippets below
Process p = Runtime.getRuntime().exec("cmd /c start Hello.bat");
p.waitFor();
Here is sample for Hello.bat
@echo off
echo "Hello World"
However, I couldn't see the output in cmd window eve there were no errors.(seem like Hello.bat file location is not right?)
My actual and final script include copying, reading, archiving, delete and return code for success or fail.
What type of script with the above methods will be fine and I hope some one will advise me for the right direction with working sample.
Thanks and best regards