Windows7 IIS7: can't turn off read-only flag for InetPub\wwwroot. Can't edit website files!

By default only administrators have write access to C:\inetpub\wwwroot. Two options:

  1. Login with an administrator account, and elevate you editor.
  2. Set IIS to use a different directory for its root folder, on which your normal account has write/delete access.
  3. Change the permissions on C:\inetpub\wwwroot.

Right click on the editor and click "Run as Administrator". By default, you cannot edit files that is in the wwwroot directory. UAC prevents the files to be edited even though you are logged on to the machine as an Administrator.

Yes, alternately change the content directory from something other than c:\inetpub\wwwroot folder.


Additional info: The read-only check box for a folder doesn't mean that the contents of the folder are read-only.

See: http://blogs.msdn.com/b/oldnewthing/archive/2003/09/30/55100.aspx

Individual files can be marked read-only, but the folder is controlled using permissions. If you have UAC enabled, starting Notepad elevated (Start, type Notepad, hit Ctrl+Shift+Enter) will avoid the issue. Or set permissions on the directory so that your user-level account has write access to it.