以下程式可一次刪除整個目錄 uses ShellApi; procedure DeleteFiles; var T:TSHFileOpStruct; begin FillChar(T, sizeof(T), 0 ); with T do begin Wnd:=0; wFunc:=FO_DELETE; pFrom:='C:\Temp\TestDel'#0#0; fFlags:=FOF_ALLOWUNDO { or FOF_FILESONLY } or FOF_SILENT or FOF_NOCONFIRMATION; end; SHFileOperation(T); end; Peter Below (TeamB) 100113.1101@compuserve.com)