Windows:
ProcessBuilder pb = new ProcessBuilder(
"cmd", "/c", "mybat.bat",
"param 1", "param 2", "param 3");
Unix:
ProcessBuilder pb = new ProcessBuilder(
"sh", "mybat.sh",
"param 1", "param 2", "param 3");
More Related Contents:
- How do I run a batch file from my Java Application?
- Run .exe file in Java from file location
- changing the working-directory of command from java
- Run .jar from batch-file
- Including jar files in class path
- Run Java file as Administrator with full privileges
- Start a java program without the console
- Windows shutdown hook on java application run from a bat script
- How can I run multiple commands in just one cmd windows in Java?
- How to get Java Version from batch script?
- Run batch file from Java code
- ProcessBuilder cannot run bat file with spaces in path
- JAVA ArrayIndexoutofBoundException issue
- Splitting on comma outside quotes
- How to map an entity field whose name is a reserved word in JPA
- Java 32-bit vs 64-bit compatibility
- The connection between ‘System.out.println()’ and ‘toString()’ in Java
- How to change color of hamburger icon in material design navigation drawer
- How to auto-download through Firefox browser using FirefoxProfile?
- rxjava: Can I use retry() but with delay?
- Sharing a variable between multiple different threads
- Is it possible to call Ant or NSIS scripts from Java code?
- Does Spring Data JPA have any way to count entites using method name resolving?
- How to get elements of JSONObject?
- Enforce not-null field in JSON object
- How to convert IEEE-11073 16-bit SFLOAT to simple float in Java?
- android: changing option menu items programmatically
- How to find a Java thread running on Linux with ps -axl?
- “Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements” in hibernate when annotating a ConcurrentHashMap
- Issue with Java Regex \b