uses Printers;
procedure TForm1.Button1Click(Sender: TObject);
var
MyFile: TextFile;
MyPrn: TextFile;
S: String;
begin
AssignPrn(MyPrn);
Rewrite(MyPrn);
AssignFile(MyFile, 'c:/autoexec.bat');
reset(MyFile);
while not EOF(MyFile)do
begin
readln(MyFile, S);
Writeln(MyPrn, S);
end;
System.CloseFile(MyFile);
System.CloseFile(MyPrn);
end;