Delphi删除文件夹及其内容

procedure DeleteDir(DirPath: string);
begin
  DirPath := 'rd "' + DirPath + '" /S /Q';
  ShellExecute(Application.Handle, nil, 'cmd.exe', PChar('/c ' + DirPath), nil, SW_HIDE);
end;

你可能感兴趣的:(Delphi删除文件夹及其内容)