Site Navigation

Feb 21, 2012

Windows 7 Updating a Read Only Directory/File

Microsoft Logo
Problem: You need to edit a read only file located in the C:\Program Files. However, you cannot reset the read only status of the file.

This is the problem I ran into when trying to edit C:\Program Files\NetBeans 7.1\etc\netbeans.conf. This is a NetBeans configuration file. The file is read only and so is the parent directory and the parent directory above it. I tried turning off the read only bit using File Explorer, the command line, you name it. Running as administrator had no effect.

Workaround: Do the following:
  1. Copy the file to a directory that you have write access to.
  2. Edit the file and make the changes you need.
  3. Rename the original readonly file. You can do this with Administrator privileges.
  4. Copy the edited file back to its original location.
Your read only file should now be edited.
Post a Comment

Favorite Links Feed