Below Command working fine from command console:**
cmd.exe /b start /b C:\Progra~1\Git\bin\sh.exe --login -i /c "sh SimpleScript.sh"
But Below code snippet is not working!!! from
java code:**
runtime generated command from java: cmd.exe /b start /b C:\Progra~1\Git\bin\sh.exe -- login -i /c "sh SimpleScript.sh"
ArrayList<
String> AppArgList = new ArrayList<String>();
AppArgList.add("cmd.exe");
AppArgList.add(" /b");
AppArgList.add(" start /b " + "C:\\Progra~1\\Git\\bin\\sh.exe"+ " -- login" + " -i");
AppArgList.add(" /c "+"\"sh SimpleScript.sh\"");
String[] arguments1 = AppArgList.toArray(new String[AppArgList.size()]);
System.out.println("Printing argument..........."+arguments1[0]+arguments1[1]+arguments1[2]+arguments1[3]);
Process proc1 = null;
Runtime rt = null;
try {
rt= Runtime.getRuntime();
proc1 =rt.exec(arguments1);
}