Hola Ecfisa
te cuento que copie el ejemplo tal cual, me instale el 7Zip y no me funciona, no da error pero no hace nada despues de dar click en el boton que llama al procedimiento
te envio todo el codigo para ver si hice algo mal
Código Delphi
[-]unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons,ShellApi;
type
TForm1 = class(TForm)
BitBtn1: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
procedure CompressBD(SourcePath, TargetPath: string);
var
zName: string;
begin
SourcePath := IncludeTrailingPathDelimiter( SourcePath );
TargetPath := IncludeTrailingPathDelimiter( TargetPath );
zName := IncludeTrailingPathDelimiter( TargetPath ) +
FormatDateTime( 'ddmmyy', Date ) + '.ZIP'; ShellExecute( 0,
'open',
PChar( GetEnvironmentVariable('Archivos de programa') + '\7-Zip\7zfm.exe' ), PChar( Format( 'a -r %s %s*.GDB',[zName, SourcePath] ) ),
nil,
SW_SHOWNORMAL );
end;
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
CompressBD( 'c:\sistemas\cnaz\base_de_datos', 'c:\sistemas' );
end;
end.
saludos !!!!