Ver Mensaje Individual
  #1  
Antiguo 02-08-2005
quake2420 quake2420 is offline
Miembro
 
Registrado: abr 2004
Posts: 28
Reputación: 0
quake2420 Va por buen camino
De nuevo problemas con el winexec

Hola amigos, mi problema es el siguiente:
Tengo un trozo de programa que lo que hace es crear archivos zip, mi problema es que la ejecucion del winexec, a veces funciona y otras veces no funciona.
El codigo es el siguiente:
Código:
 
rutaT:=directorio + '\';
//Creacion del archivo zip donde se guarda
//los archivos wpa, xml y dtd
copyfile(PChar(rutaT + 'contenido.xml'),
PChar(rutazp + 'contenido.xml'),existe);
copyfile(PChar(rutaT + 'estilo.xml'),
PChar(rutazp + 'estilo.xml'),existe);
copyfile(PChar(rutaT + 'nuevo.dtd'),
PChar(rutazp + 'nuevo.dtd'),existe);
copyfile(PChar(rutaT + nombreA + '.wpa'),
PChar(rutazp + nombreA + '.wpa'),existe);
rutazp1:='"'+rutazp+'"';
zipf:=nombreA + '.wzp';
wpaf:=nombreA+'.wpa';
diractual:=SetCurrentDir(rutazp);
winexec(Pchar('crearzip.bat ' + rutazp1 + ' ' + zipf + ' '
+ wpaf),SW_hide);
sleep(1000);
copyfile(PChar(rutazp + zipf),PChar(rutaT + '\' + zipf),existe);
deletefile(PChar(rutazp + 'contenido.xml'));
deletefile(PChar(rutazp + 'estilo.xml'));
deletefile(PChar(rutazp + 'nuevo.dtd'));
deletefile(PChar(rutazp + wpaf));
deletefile(PChar(rutazp + zipf));
El archivo bat que utlizo tiene el siguiente contenido
Código:
cd %1
7z a %2 contenido.xml estilo.xml nuevo.dtd %3
donde %1 es el directorio donde se encuentra el ejecutable del zip, %2 es el archivo .zip y %3 es un archivo de tipo wpa
Gracias por adelantado
Responder Con Cita