program ENUFDISC { www.merlyn.demon.co.uk >= 2002-06-21 } ; uses Dos ; var DF, Min : longint ; N : integer ; D : byte ; S : string [3] ; BEGIN ; s := ParamStr(1) ; if S='/?' then begin Writeln('ENUFDISC [drive [Minimum]]') ; HALT end ; D := 0 ; if ParamCount>0 then begin S[1] := UpCase(S[1]) ; if S[1] in ['A'..'Z'] then D := Ord(S[1]) - Ord(Pred('A')) else begin Val(ParamStr(1), D, N) ; if N<>0 then begin Writeln('Param 1 error!') ; HALT end ; end ; end ; DF := DiskFree(D) ; if (DF>=0) and (ParamCount>1) then begin Val(ParamStr(2), Min, N) ; if N<>0 then begin Writeln('Param 2 error!') ; HALT end ; DF := Ord(DF>=Min) ; end ; Writeln(DF) ; END. With no parameter, returns free space on default disc. With one parameter, returns free space on that disc; 0 = default, 1.. or a.. or A.. is drive A... With a second parameter Minimum, returns 1 if that much is free, else 0. Result to standard output; can use STOW to environment, Max number is 2^31-1; truncated if free space is bigger. An inoperable or non-existent drive gives -1.