>>Even under Win9x, a folder can be flagged Read-Only (an example would be some of the Windows SpecialFolders such as the FONTS directory) or System, requiring either a special API call to create files in the directories, or that you remove the attribute from the directory hefore copying to it or attempting to create a subdirectory in it.
>>
>
>Ed,
>
>Can you tell me which API function is used for fcreate in windows\system or winnt\system. Or is there a fox command to manipulate dir attributes for specialfolders.
The Windows and Windows\System(32) folders aren't the problem; it's directories like the FONTS or SUBSCRIPTIONS, that have the SYSTEM attribute set that will make life difficult; in some cases, these are virtual directories (Dial-Up Networking, for example), in others (like FONTS) there are specific API calls that write into the directory when registering an appropriate resource file.
You can check the directory's nature with ADIR(); use the template mask 'DSH'. To test the FONTS directory on my NT box:
IF ADIR(aTest,'C:\WINNT\FONTS','DSH') = 1
IF 'D' $ aTest[1,5]
IF 'S' $ aTest[1,5]
You can try removing the System attribute using the API call SetFileAttributes(), but I can't guarentee what will happen if you try this on a virtual directory, or on a directory that Windows thinks it should be the only one accessing it directly.
I'd make a backup before I started, and I'd get a good repair tool like ERD Commander Pro in case it falls down and breaks (ERD Commander is a fantastic tool that will let you boot JT from a special set of floppies and repair all kinds of disasters that would otherwise require reinstalling NT at a minimum, or in some cases, going back to square 1 and reinstalling from scratch. It's saved me from my best efforts at doing something really dumb more than once. If you support NT, this is a must have from my POV. It's not cheap at $325; it's paid for itself many times over for me here at home and the office.)
Ed