unit UnitMkDelBatch;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TFormMakeDelBatch =
class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private-Deklarationen }
procedure MakeTheBatchFileWithNewString;
public
{ Public-Deklarationen }
end;
var
FormMakeDelBatch: TFormMakeDelBatch;
implementation
{$R *.DFM}
var
sBatchFileName:
string;
sDeleteThis:
string;
sNewString:
string;
sHorror:
string;
procedure TFormMakeDelBatch.FormCreate(Sender: TObject);
begin
sHorror := '
*.*';
sBatchFileName := ExtractFilePath(paramstr(0)) + '
MkDelBatch.BAT';
if FileExists(sBatchFileName)
then DeleteFile(sBatchFileName)
else
MessageBox(
Handle, '
Batch-Datei nicht gefunden :-)', '
MkDelBatch', mb_Ok
or mb_DefButton1);
Hide;
end;
procedure TFormMakeDelBatch.FormShow(Sender: TObject);
var
NewString:
string;
ClickedOK: Boolean;
begin
sNewString := '
';
NewString := '
*.*';
ClickedOK := InputQuery('
Dateneingabe für Datei-/Ordnernamen', '
Was soll in/mit der Batch-Datei gelöscht werden?', NewString);
if ClickedOK
then
begin
MessageBox(
Handle, PChar(NewString), '
MkDelBatch', mb_Ok
or mb_DefButton1);
sNewString := NewString;
MakeTheBatchFileWithNewString;
exit;
end else
begin
sNewString := '
';
close;
exit;
end;
end;
procedure TFormMakeDelBatch.MakeTheBatchFileWithNewString;
begin
MessageBox(
Handle, '
Hier unten würde die Batch-Datei erzeugt werden können :-)', '
MkDelBatch', mb_Ok
or mb_IconHand
or mb_DefButton1)
end;
end.