Enable or disable Control Panel in windows 8 (VBScript)

Introduction

The goal of this script is to enable or disable Control Panel on Windows 8.

Scenarios

Sometimes administrators want to prevent the access to Control Panel for ensuring security.

Script

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.

VB Script
Edit|Remove
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 

Prerequisite

Windows 8 

Additional Resources

CreateObject