I have a JAR program that works fine when I manually run it, however, when I run it in Task Scheduler it will not run, on the history it keeps running OpenWith.exe as shown below:
Task Scheduler successfully completed task "\P&LAAT Export" , instance "{9fbf2238-7871-4343-aec0-91100bf933dc}" , action "C:\Windows\system32\OpenWith.exe" with return code 0.
To try and rectify this issue I have edited the action of the task where it runs the JAR file and added the following argument:
-jar "C:\Program Files\Java\jdk-16.0.1\bin\java.exe"
I have also tried javaw instead of java, and the "Open With" is still prompting instead of running the JAR file with the necessary libraries. It's also running on Admin Privileges so it isn't an Administration or User issue.
Can anyone else see the problem here? I am not sure what else to do.