The goal of this script is to enable or disable Control Panel on Windows 8.
Sometimes administrators want to prevent the access to Control Panel for ensuring security.
Step 1: Press Win key and "X", and select "Command Prompt (Admin)"

Step 2: Type command like the following:Cscript.exe filepath

Note If you want to enable the control panel, just re-run the script.
Here are some code snippets for your references. To get the complete script sample, please click the download button at the beginning of this page.
If KeyExists(Path) Then
'enable control panel
wshshell.RegDelete(path)
If Err.Number = 0 Then
WScript.Echo "Control panel has been enabled."
Call RefreshExplorer
Else
WScript.Echo Err.Description
End If
Err.Clear
Else
'disable control panel
wshshell.RegWrite Path,1,"REG_DWORD"
If Err.Number = 0 Then
WScript.Echo "Control panel has been disabled."
Call RefreshExplorer
Else
WScript.Echo Err.Description
End If
Err.Clear
End If
If KeyExists(Path) Then 'enable control panel wshshell.RegDelete(path) If Err.Number = 0 Then WScript.Echo "Control panel has been enabled." Call RefreshExplorer Else WScript.Echo Err.Description End If Err.Clear Else 'disable control panel wshshell.RegWrite Path,1,"REG_DWORD" If Err.Number = 0 Then WScript.Echo "Control panel has been disabled." Call RefreshExplorer Else WScript.Echo Err.Description End If Err.Clear End If
Windows 8
Additional Resources