//判断 if not Fileexists('c:\2.exe') then begin //如果文件不存在 end; if not Directoryexists('C:\Program Files\test') then begin //如果文件夹不存在 end; // delphi创建和删除文件夹 1.本目录创建和删除test文件夹 uses段中添加对ShellApi CreateDirectory(PChar(ExtractFilePath(ParamStr(0))+'Test'),nil);//创建 RemoveDirectory (Pchar(ExtractFilePath(ParamStr(0))+'Test'))//删除