Question

5
Replies
517
Views
X
DavidD95 Member since 2017 3 posts
NTT Data
Posted: 1 year ago
Last activity: 10 months 3 weeks ago
Solved

Trying to execute a .bat file from an activity rule

I'm trying to execute a .bat file from an activity rule. The logic in a similar post is not working as a .bat. I've tried several ways to get it to run. It doesn't throw an error, but the Java step does not seem to execute the .bat file. Any help is appreciated. I'm using PRPC 7.1.8. I have to execute a .bat file, so not doing it is not an option.

Logic 1

ProcessBuilder pb = new ProcessBuilder("d:\\DEV\\Forms\\PrintPageToPDF_F-9015.bat");

try{

Process process = pb.start();

}

catch(java.io.IOException ioEx) {

oLog.error("WritePDFScriptFiles - ", ioEx);

}

Logic 2

String path="cmd /c start d:\\DEV\\Forms\\PrintPageToPDF_F-9015.bat";
Runtime rn=Runtime.getRuntime();
Process pr=rn.exec(path);

Logic 3

String[] cmdArray = new String[3];
cmdArray[0] = "cmd.exe";
cmdArray[1] = "/c";
cmdArray[2] = "d:\\DEV\\Forms\\PrintPageToPDF_F-9015.bat";
Runtime.getRuntime().exec(cmdArray);

Data Integration Java and Activities
Share this page LinkedIn