How to use event or java to call extenal .bat file which located in windows server
Hi,
is it possible to call .bat file through script PX or java, and the script is located in external windows server
Hello,
It’s possible to execute a Windows batch file using Java’s Process Explorer API. Please see detailed information in the below articles, you should get good idea about how you can reuse these in calling a .bat file from you Script or Java PX.
Java – How to run Windows bat file – Mkyong.com
How do I run a batch file from my Java Application? – Stack Overflow
Hi Swagoto,
thanks for the information.
suddenly i can not find “inernal custom action” to choose .jar file, how to add new jar in extention list ?
Hi,
thanks, for information.
create text file under META-INF/services in java (Eclips) tool
- edit com.advtek.hello in this file, and
- edit import com.agile.px.ICustomTable; in java file
- compile java file as .jar
- put .jar file to server “extension” folder
- login JavaClient and setup process extension, where can choose the internal custom action
Hi,
i call the batch by action bottom.
throw exception >> java.lang.ClassCastException: com.advtek.hello
what is mean ?
i use the java code like this:
public class hello {
public static void main(String[] args) {
{
try {
String[] command = {“cmd.exe”, “/d”, “Start”, “D:\\temp\\hello.bat”};
Process p = Runtime.getRuntime().exec(command);
} catch (IOException ex) {
}
}
}
}