Windows permission problem
Hi I need to save a file in c:/windows/system32/drivers
folder. But when I try to save it is not allowing me. I tried to change permissions by right clicking that folder and modifying in the security tab. Yet it is not allowing me to change. what should be done in order to gain acce开发者_C百科ss privilege??
Have you tried editing the hosts file using Notepad launched via the "Run as administrator" command?
According to the knowledge base article, if you get an error message that looks like this:
Access to C:\Windows\System32\drivers\etc\ hosts was denied
Or like this:
Cannot create the C:\Windows\System32\drivers\etc\hosts file. Make sure that the path and file name are correct.
Try this:
Start → All Programs → Accessories → right-click "Notepad" → Run as administrator → Modify hosts file appropriately → Save
Note:
Adding/modifying the files in the system directories is a very, very, very bad idea. It is acceptable for this specific case of the hosts file, but in general adding and modifying files in the system folders is verboten.Short answer: Are you an admin on the system? If not, then you can't edit permissions of system folders. (And, depending on the version of Windows, it may be difficult/obtuse even for an Admin to do it.)
Long answer: You shouldn't be doing this. That path (and many like it) is used by the OS for its own design and its own purposes. You probably don't want to mess with it. You may unintentionally break something. It's also a very unintuitive place to store things that aren't part of the OS installation. What are you trying to store there and why? If it's part of an application, it should be stored with that application. If it's something for a user, it should be stored in the user's space. Etc.
Edit: Based on your comment in response to your question: The hosts
file is actually one level down from there, in the etc
folder that's under drivers
. You shouldn't have to change any folder-level permissions to edit that. If you can't edit the file, try to change its permissions. If you can't do that, it doesn't sound like you have admin rights, which you'll probably need.
Try saving it to another place (Documents perhaps?) and then copy it there. It will ask you if you're sure you want to do it, but at this point say yes and it'll copy the file there. Windows won't let you simply create a file in c:/windows/system32/drivers for obvious reasons.
And I don't need to tell you to be careful, do I? Hmm??
I was having this issue and opening notepad by right clicking it and selecting "run as administrator" I then opened and edited the hosts file and it allowed me to save where it did not before.
精彩评论