procedure ZsDelPath(mDirName: string); { 删除指定路径 }
var
  Sr: TSearchRec;
  PathName: string;
  K: Integer;
begin
  PathName := mDirName + '\*.*';
  K := FindFirst(PathName, faAnyFile, Sr);
  while K = 0 do begin
    if (Sr.Attr in [faDirectory]) and (Pos(Sr.Name, '..') = 0) then begin
      Sr.Attr := 16;
//    ~~~~~~~~~~~~
      ZsDelPath(mDirName + '\' + Sr.Name);
    end else if Pos(Sr.Name, '..') = 0 then begin
      Sr.Attr := 0;
//    ~~~~~~~~~~~~
      DeleteFile(PChar(mDirName + '\' + Sr.Name));
    end;
    K := FindNext(Sr);
  end;
  RmDir(mDirName);
end; { ZsDelPath }

解决方案 »

  1.   

      faReadOnly  = $00000001 platform;
      faHidden    = $00000002 platform;
      faSysFile   = $00000004 platform;
      faVolumeID  = $00000008 platform;
      faDirectory = $00000010;
      faArchive   = $00000020 platform;
      faAnyFile   = $0000003F;
      

  2.   

    //找到一个更简单的!!!FileSetAttr('C:\temp\1.txt', faReadOnly or faHidden);
      

  3.   

    attrib +/-h +/-s +/-a +/-r
      

  4.   

    在dos下可用
    attrib +r +s +h 文件名 添加属性
    attrib -r -s +h 文件名 去掉属性
    r 代表只读
    s 代表系统
    h 代表隐藏
      

  5.   

    帅哥们!!
    看清楚了!!
    我问的是相关的DOS命令!!
    vcl那套我会!