A user can view source from the View / Source menu and by pressing View Source on the right-click context menu.

To prevent a user from viewing source files, you must disable both capabilities.

In tip 6315, we used Group Policy to enabled Disable Context menu.

To disable the View / Source menu, enable the View menu: Disable Source menu option at User Configuration / Administrative Templates / Windows Components / Internet Explorer Browser menus.

If the policy is Not Configured, you can Merge the following NoViewSource.reg file with the user's registry, or run regedit /s NoViewSource.reg:

REGEDIT4

\[HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Restrictions\]
"NoViewSource"=dword:00000001