Posts
1150
Comments
891
Trackbacks
1
Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub

I rarely ever put any code in C:\Inetpub, but some applications will put their websites there by default.

And you may find yourself surprised when, even when using an Administrator account, you don’t have permissions to update files or save files under that location.

Turns out it is an UAC issue.  From Thomas Deml, a Program Manager for IIS at Microsoft, in this post:

Here is an easy fix. Run the following command from an elevated command prompt (right click the "command prompt" icon and select "Run as Administrator").

icacls %systemdrive%\inetpub /grant  %userdomain%\%username%:(OI)(CI)(F) /grant %userdomain%\%username%:F

Note, do not replace any of the values in between the %% signs, just run it as is.  Voila.

No, I don’t know what “(OI)(CI)(F)” means either.

posted on Sunday, November 22, 2009 7:06 PM Print
Comments
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
Rahul Soni
11/24/2009 4:07 AM
(OI) = Object Inherit
(CI) = Container Inherit
F = Full

I believe you are just giving the perms to the inetpub folder and the files beneath.
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
jdn
11/24/2009 5:35 PM
Ah, thanks for that info, much appreciated.
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
gus
2/10/2010 4:39 PM
i can't save into my inet pub folder it is asking me to contact the administrator even when i logged in as one....can anyone help
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
George
3/9/2010 7:45 PM
BEAUTIFUL! Thanks!
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
Asan
5/28/2010 3:35 AM
Thanks a lot!
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
Chris
1/19/2011 1:40 PM
Thank you!
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
mikias
2/7/2011 11:08 PM
hi cant find inetpub/wwwroot in my C folder. i am using windows 7. anybody has any idea
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
amie
2/16/2011 3:04 AM
hi mikias,
you'll have to install IIS which does not come by default with your windows installation.

please insert your windows installation CD into your CD drive, go to start-control panel-programmes and features. on d left hand side in the window under TASKS, click TURN WINDOWS FEATURES ON OR OFF (this should be the last option on the list.when the User access control window appears, click CONTINUE. select IIS from the list and install it. GOOD LUCK!
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
winterjunkie
2/16/2011 8:10 AM
Thank you! Thank you!
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
Mose
3/28/2011 8:53 AM
Worked great. Thanks!
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
prithvi
3/29/2011 5:55 AM
Thanks. Worked like a charm.
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
Mr. Reality
4/29/2011 4:34 PM
Tried it but it didn't work. Then I tried this and it hworked perfectly. I ran the editor as an administrator. It is simple (Right click on the program, and a drop down menu with "Run as an Administrator" will apply. Simply click on it and your editor will start with all your problems solved
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
Maulana
9/10/2011 6:17 AM
guys, I think I found easier way, right click your wwwroot folder, choose 'share with'
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
Gerard
2/28/2012 5:24 AM
I agree: Sharing is the easiest sollution....
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
Neil
4/30/2012 9:46 AM
Note that for user names with spaces (common with local accounts under Win7) you have to quote the variables:

icacls %systemdrive%\inetpub /grant "%userdomain%\%username%":(OI)(CI)(F) /grant "%userdomain%\%username%":F

And do make sure you're running from an elevated command prompt! If the window doesn't say "Administrator: Command Prompt" at the top, you'll get an error.
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
jdn
4/30/2012 7:00 PM
@Neil

Thanks for the additional information. Much appreciated.
Gravatar
# Brilliant
Tuan Jinn
7/13/2012 4:25 AM
AWESOME! Thanks mate!
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
BENTOO
6/10/2015 11:02 PM
THANK YOU
Gravatar
# re: Windows 7 /Vista – Can’t Edit or Save Files in C:\Inetpub
MoonDawg
7/9/2015 9:31 PM
Could not have been easier.

Thanks!

Post Comment

Title *
Name *
Email
Url
Comment *  
Please add 2 and 3 and type the answer here: