Encyclopedia

818Currently online
118Today's Reading
42Share Today
Multilingual display

JAVA execution batch file solution

2018-05-09 00:00:23

Java is a cross-platform language, and we often encounter the need to call some programs under windows through Java. Some third-party vendors, such as ANT, also provide methods for calling windows executable programs, but we often need to call some batch processing commands. Java does not provide that. Here, I use a variant of the call method that allows Java to invoke batch commands.

Tools/Materials

Quick Batch File (De)Compiler

Steps/methods
1

Run the exe file. Java JDK has provided the method of calling, not cumbersome, the code is as follows. try { String command = 'notepad';  Process child = Runtime.getRuntime().exec(command);  } catch (IOException e) {}

2

This page is taken from experience without authorization

Matters needing attention

80ticking.com Search for "JAVA execution processing file"

Recommendation