Const ctOutputPath = 'C:\Test\Out\'; // Must end with a \ Begin psExitCode:= 0; // ... add your code here // Function psChangeTxtEncodingCkExt(Source, Destination: String; SrcCharset, DstCharset: String; WriteBOM, WriteFileIfModified: Boolean): Boolean; If psChangeTxtEncodingCkExt(psFilePath + psFileName, ctOutputPath + psFileName, 'utf-8', 'utf-8', False, False) Then Begin psExitCode := 1; psLogwrite(1, '', 'Removed BOM Successfull from ' + psFilePath + PsFileName); End Else psLogwrite(1, '', 'Remove BOM Error from ' + psFilePath + PsFileName) End.