String path = "C:\CopiaSeg.sql";
if (!(new File(path)).exists()) {
String cad = "\"" + ruta_mysqldump + "\" --opt --password=" + password + " --user=" + usuario + " " + db + " > \"" + path + "\"\n";
File fcopi = new File("copia_seguridad.bat");
FileWriter fw = new FileWriter(fcopi);
fw.write(cad, 0, cad.length());
fw.close();
pausa(2000);//espero 2 segundos
Process p = Runtime.getRuntime().exec("copia_seguridad.exe");
}