Question

5
Replies
636
Views
David Dekle (DavidD95)
NTT Data
BPM Solutions Architect
NTT Data
US
DavidD95 Member since 2017 3 posts
NTT Data
Posted: February 12, 2019
Last activity: August 16, 2019
Posted: 12 Feb 2019 16:52 EST
Last activity: 16 Aug 2019 11:30 EDT
Closed
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();

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
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.