现在的位置: 首页 > 综合 > 正文

windows2008下如何删除程序自身收藏

2013年08月23日 ⁄ 综合 ⁄ 共 1280字 ⁄ 字号 评论关闭
  windows2008下如何删除程序自身收藏


 | 旧一篇: 写程序启动项时如何过卡巴与360安全卫士等软件的方法


procedure DeleteMe;
var
  BatchFile: TextFile;
  BatchFileName: string;
  ProcessInfo: TProcessInformation;
  StartUpInfo: TStartupInfo;
begin
  BatchFileName := ExtractFilePath(ParamStr(0)) + ' _deleteme.bat' ;
  AssignFile(BatchFile, BatchFileName);
  Rewrite(BatchFile);

  Writeln(BatchFile, ' : try' );
  Writeln(BatchFile, ' del "' +ParamStr(0) + ' "' );
  Writeln(BatchFile,
    ' if exist "' +ParamStr(0) + ' "' +' goto try' );
  Writeln(BatchFile, ' del %0' );
  CloseFile(BatchFile);

  FillChar(StartUpInfo, SizeOf(StartUpInfo), $00);
  StartUpInfo.dwFlags := STARTF_USESHOWWINDOW;
  StartUpInfo.wShowWindow := SW_HIDE;
  if CreateProcess(nil, PChar(BatchFileName), nil, nil,
    False, IDLE_PRIORITY_CLASS, nil, nil, StartUpInfo,
    ProcessInfo) then
  begin
    CloseHandle(ProcessInfo.hThread);
    CloseHandle(ProcessInfo.hProcess);
  end;
end;

发表于 @ 2008年10月09日 10:42:00|评论(6)|收藏


 | 旧一篇: 写程序启动项时如何过卡巴与360安全卫士等软件的方法

抱歉!评论已关闭.