When using .exec(cmd)
, prefix your command with cmd /c
so you end up with something like rt.exec("cmd /c <your command>")
. This will launch the process and invoke the UAC if needed.
More Related Contents:
- How to convert JOptionPane String Input into an Int? [duplicate]
- Why an instance of class MqttClient must be enclosed by try/catch?
- Why my program crash when i press back Button
- How to establish a connection pool in JDBC?
- Java Class that implements Map and keeps insertion order?
- In what order do static/instance initializer blocks in Java run?
- Synchronizing on String objects in Java
- Difference between thread’s context class loader and normal classloader
- Eclipse java debugging: source not found
- Cannot resolve constructor FirefoxDriver(org.openqa.selenium.firefox.FirefoxProfile)
- Can I have a textfield inside a label?
- How do I create a jagged 2d array in Java?
- How to Set the Background Color of a JButton on the Mac OS
- Is there an alternative to JPasswordField?
- Benefits and drawbacks of method chaining and a possibility to replace all void return parameters by the object itself
- How do I set cell value to Date and apply default Excel date format?
- With Java 7 Update 45, the System Properties no Longer Set from JNLP Tag “Property”
- Spring: define @RequestMapping value in a properties file
- Configure DataSource programmatically in Spring Boot
- How to pass the -D System properties while testing on Eclipse?
- maven “cannot find symbol” message unhelpful
- non-blocking IO vs async IO and implementation in Java
- Difference between String trim() and strip() methods in Java 11
- How do you know a variable type in java? [duplicate]
- Running a method when closing the program?
- Compiling and running with JavaFX 2.1
- How much interfaces a class file can implement [closed]
- What does equals(Object obj) do?
- Does java have a “LinkedConcurrentHashMap” data structure?
- How to use JTA support in Tomcat 6 for Hibernate?