you can build dynamic command as String and Run it by Invoking :Runtime.getRuntime().exec(String command);