Tell me how to properly run java files on a remote computer via task sheduler. I tried to do it in two ways:

  1. Run java file itself. The launch is in progress, but I need the process to remain hanging on the command line, and not immediately close. Edit java file is not possible.

  2. Record the launch of the java file in bat. In this case, the launch is normal, and the process remains to hang on the command line, but since the command line has its own name, I can’t stop the task later.

  • You can write your own program, which will control the call and monitoring of the program, or (in the case of windows) via .bat script, java -jar and the next line pause so that the console does not close - DaysLikeThis
  • I need it through task sheduler. The bat script launches the console, but then I cannot close it with the same task in the task sheduler, since this file has a different name, and the task shedulere says to start / stop test.bat - Natali
  • It is not clear what the problem is with option number 2? The console window can be found by the launch command. For example, you can find and kill the java window launched (with such parameters) with the following command: wmic process where (name = "java.exe" and commandline like "java.exe -Xmn2G%") call terminate - Daemon-5

0