Home > Mobile >  How I can execute .exe file in java
How I can execute .exe file in java

Time:02-27

How I can execute .exe file in java program Microsoft Word/Excel/Access/, Chrome, Notepad, Word pad,Any Compiler, any file open and close with cmd; in Java and Php programming language

CodePudding user response:

You can use Java Process Builder. You need to give the full path of the executable if it is not in current working directory.

CodePudding user response:

in java:

Runtime runTime = Runtime.getRuntime();
String yourExe = "C:\\Path\\To\\Your\\Exe\\notepad.exe";
Process process = runTime.exec(yourExe);

CodePudding user response:

In PHP you can use exec or system commands to execute external programs

   <?php
   system("notepad.exe");
   system("notepad.exe c:\\temp\\data.txt");
   exec("notepad.exe c:\\temp\\data.txt");
   ?>
  • Related