See
How to change file attributes programmatically FAQ #15763.
>I am trying to find a Windows API call that will allow me to change a file's property to readonly, and back again. I'm currently using the the old RUN command, but that makes the DOS window display and is really annoying. Placing the /N (NOWAIT) works is some instances where the following command is not effected. I'd really like to do this as clean as possible. Any ideas out there?
>
>Jason.
--sb--