home *** CD-ROM | disk | FTP | other *** search
- program HideIt ;
-
- { Utility program to hide files and directories;
- by Mike Davenport, Neil Rubenking, and Andy Moore }
-
- uses Dos ;
-
- var
- F : file ;
- ATT : word ;
-
- begin
- if ParamCount = 0 then
- begin
- writeln('Enter the file/directory name to hide on the command line') ;
- Halt(1) ;
- end ;
- Assign(F, ParamStr(1)) ;
- GetFAttr(F,ATT) ;
- ATT := ATT and $E7 ; { Mask off DIRECTORY and VOLUMEID bits }
- SetFAttr(F,ATT + HIDDEN) ;
- case DosError of
- 0 : writeln(ParamStr(1), ' successfully hidden') ;
- 1 : writeln('Invalid Function') ;
- 2 : writeln('File Not Found') ;
- 3 : writeln('Path Not Found or File Does Not Exist') ;
- 5 : writeln('Access Denied - Attribute Cannot Be Changed') ;
- else
- writeln('Unanticipated DOS Error = ',DosError) ;
- end ;
- end.
-