Yes, you can. But you will need to run this command after that:
%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
This will re-create application mappings in IIS, and it will instruct IIS how to handle ASPX, ASMX, ASCX and other ASP.NET files.