Implement an external call exe file with Java

xiaoxiao2021-03-06  39

1.0 Call the EXE file of the Windows system with Java, such as Notepad, Calc, CALC, Calc, Calc, Public, (String Args [) {runtime rn = runtime.Getruntime (); Process P = NULL;

Try {p = rn.exec (NOTEPAD);} catch (exception e) {system.out.println ("ERROR EXEC NOTEPAD");}}} 2.0 calls other executables, such as the EXE produced, or It is a download installed software public class demo {public static void main (string args []) {runtime rn = runtime.Getruntime (); process p = null;

Try {p = rn.exec ("/"} ");} catch (exception e) {system.out.println (" Error Exec Anyq ");}}}

转载请注明原文地址:https://www.9cbs.com/read-63371.html

New Post(0)