public static boolean ejecutaCommando(String comando, String[] params,
			String[] envVars) throws IOException, InterruptedException {
		boolean ret = false;
	
			Runtime run = Runtime.getRuntime();
			if (comando == null || comando.trim().equals("")) {
				return false;
			}

			StringBuffer aEjecutar = new StringBuffer();
			aEjecutar.append(comando);
			String separador = " ";
			if (params != null) {
				for (int i = 0; i < params.length; i++) {
					aEjecutar.append(separador + params[i]);
				}
			}
			aEjecutar.append(separador);

			Process prc;
			if (envVars == null || envVars.length == 0) {
				prc = run.exec(aEjecutar.toString());
			} else {
				prc = run.exec(aEjecutar.toString(), envVars);
			}

			InputStream err = prc.getErrorStream();
			InputStream std = prc.getInputStream();
			BufferedReader salidaStandar = new BufferedReader(
					new InputStreamReader(std));
			StringBuffer strd = new StringBuffer(), serr = new StringBuffer();
			String SALTO_LINEA = "\n";

			for (String str = salidaStandar.readLine(); str != null; str = salidaStandar
					.readLine()) {
				strd.append(str + SALTO_LINEA);
			}

			BufferedReader salidaError = new BufferedReader(
					new InputStreamReader(err));
			for (String str = salidaError.readLine(); str != null; str = salidaError
					.readLine()) {
				serr.append("Error : " + str + SALTO_LINEA);
			}

			int result = prc.waitFor();
			prc.destroy();
			if (result == 0) {
				ret = true;
			} else {
				ret = false;
			}
	
			return ret;
	}