This is the very common error that any web programmer can face when we web share a folder.The solution is to remove the virtual directory entry from the IIS window. But what if the entry does not exist in the IIS window. This situation comes when you delete/move the folder from the c:\inetpub\wwwroot folder before deleting its virtual directory. So the solution is to remove the virtual directory entry from the IIS.
Here is the Procedure to remove virtual directory entry from the IIS database?
Here are the 3 ways how we can do this.
1. Use following command
Syntax
iisweb /delete WebSite [WebSite...][/s Computer [/u[Domain\]User/p Password]]
You can get more help on this from here.
2. Recreate the folder with the same name in the c:\inetpub\wwwroot and then restart the IIS (use iisreset.exe). You will see the virtual directory with the same name in the IIS window, now remove the virtual directory from IIS.
3. Use the following command by opening the command prompt.
c:\inetpub\wwwroot\cscript adsutil.vbs DELETE "W3SVC\1\root\"
For more information on adsutil.vbs.
Hope this helps.