Hola a todos.
Tengo un jApplet firmado donde al ejecutar lo siguiente no me abre la shell de windows cmd en este caso:
Código:
//.............................................
if (jList1.getSelectedIndex()==0) {
//la cadena resultante = cmd /K title "chkdsk /?" && color 17 && "chkdsk /?"
//cadena="cmd /K title \"chkdsk /?\" && color 17 && \"chkdsk /?\""
cadena="cmd /K title \"" + jList1.getSelectedValue().toString() + "\" && color 17 && " + jList1.getSelectedValue().toString() + " /?";
Runtime aplicacion = Runtime.getRuntime();
try{
aplicacion.exec(cadena);
}
//....
Pero en cambio en el mismo jApplet esto si me funciona:
Código:
//........
Runtime aplicacion0 = Runtime.getRuntime();
try{
aplicacion0.exec("cmd /c shutdown -s -t 05 -c \"Se va a apagar el equipo en 5 sg - si lo desea anule con el boton anular\"");
}
//......
Si ejecutas en windows:
Código:
c:\> cmd /K title "chkdsk /?" && color 17 && "chkdsk /?
Se abre la shell sin ningún problema
¿Alguien tiene alguna idea?. El Applet está firmado sin restricciones ...
salu2