How to Suppress Windows Security Alert when Launching Java Program via CMD?

Viewed 127

I'm launching a program with administrative privileges in Java using the CMD:

try {
    Runtime.getRuntime().exec(cmd, null, new File(processDir));
} catch (IOException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
}

This causes the Windows Security Alert dialog to appear:

enter image description here

I would like to suppress the dialog from appearing as this would require manual input for a program that is suppose to be fully automated.

1) Is it possible to execute a specific command in a way that prevents the dialog from appearing for that command?

2) If not, is it possible to programmatically disable the dialog from ever appearing?

Presumably, I could completely disable Windows Defender Firewall but this isn't ideal.

I'm using Java + Windows 10.

Thanks

0 Answers
Related