1. Use regedit directly
Open the Windows Registry
Goto the following path
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
create a new DWORD value named "NoViewContextMenu".
set its value to "1" to disable right click.
set its value to "0" to enable right click.
2. Or, create a .REG file
To Enable Right mouse button
************************
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoViewContextMenu"=dword:00000000
************************
To Disable the right mouse button
************************
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoViewContextMenu"=dword:00000001
************************
Copy the required script, and paste it into "Notepad". Save the file as no_mouse_right.reg or enable_mouse_right.reg or whatever you care to do.
Double click to modify the registry, or use regedit /s filename.reg in the logon script.