I want to create a window through CMD / K start, start the jar package in this new window and get the PID of the jar package.I've tried some methods, but none of them can.
pid = Popen(['cmd', '/k', 'start', 'java', '-jar', 'project-0.0.1-SNAPSHOT.jar'], shell=False).pid
pid = Popen(['java', '-jar', 'project-0.0.1-SNAPSHOT.jar', 'cmd', '/k', 'start'], shell=False).pid
Is there any way?