Hi
I am having difficulty running my java program to execute UNIX script on a Windows box. Here is my code.
public boolean executeScript() {
try {
String testScript= "WEB-INF/scripts/test.sh";
File file = new File(copyToQaScript);
System.out.println(file.getAbsolutePath());
Process proc = Runtime.getRuntime().exec(file.getAbsolutePath());
} catch (IOException ioe) {
ioe.printStackTrace();
logger.error(ioe);
} catch (RuntimeException re) {
re.printStackTrace();
logger.error(re);
} catch (Exception e) {
e.printStackTrace();
logger.error(e);
}
return true;
}
When I execute this method, I am getting IOException as below.
java.io.IOException: CreateProcess: C:\tomcat-5.0.28\webapps\myProject\WEB-INF\scripts\test.sh error=193
Can anyone help me? Thanks.