Sometimes while you are removing SharePoint 2010 server from your machine and re-install it , and run the SharePoint 2010 products configuration wizard in the 4th step you may face ,this error “Couldn’t find file c:\Windows\System32\drivers\etc\hosts” or even couldn’t access it, the reason i think is that “hosts” file which path is in “c:\Windows\System32\drivers\etc\” may be deleted or modified, during removing your SharePoint installation by the SharePoint timer service, So what we shall do is re-creating this file again?
i’m not going to discuss the function of this file you can found it by “Google” it :).
step-1: go to the following path:”c:\Windows\System32\drivers\etc\”, and create a new text file, and insert the following text inside it:
# Copyright (c) 1993-2008 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 220.127.116.11 rhino.acme.com # source server # 18.104.22.168 x.acme.com # x client host 127.0.0.1 localhost
This is a typical content though the only important part is this line ” 127.0.0.1 localhost”.
step-2 Save this file as hosts but remove the .txt extension
Now the last step is to apply appropriate permissions for WSS_Admin_WPG to it. If you don’t, you are just going to encounter another error (This time a permission error: Access to the path ‘C:\WINDOWS\system32\drivers\etc\HOSTS’ is denied).
To do so, just right click the hosts file and select properties then, security tab, then edit, then Add..,then type WSS_Admin_WPG and click check names and ok, don’t forget to allow modify option like below:
Now re-run the SharePoint 2010 products configuration wizard again and i hope that your installation successfully complete .