delphi 程序自删除函数 DeleteMe 德州行业网
- procedure DeleteMe;
- var
- BatchFile: TextFile;
- BatchFileName: string;
- ProcessInfo: TProcessInformation;
- StartUpInfo: TStartupInfo;
- begin
- BatchFileName := ExtractFilePath(ParamStr(0)) + '$$del$$.bat';
- AssignFile(BatchFile, BatchFileName);
- Rewrite(BatchFile);
- Writeln(BatchFile, ':try');
- Writeln(BatchFile, 'del "' + GetShortName(ParamStr(0)) + '"');
- Writeln(BatchFile, 'if exist "' + GetShortName(ParamStr(0