Version: 1.0
Date: 21 May 2022
Author: Stefan vd, Chrome Product Expert
Product Expert Profile
This batch script is designed to remove Google Chrome policies that may be managed by Group Policy in Windows. These policies are often used by organizations to enforce specific Chrome settings, and removing them can help reset Chrome to its default state on systems where such policies are no longer required or were accidentally applied.
- Closes all running instances of Google Chrome
- Deletes Group Policy folders that may enforce Chrome policies
- Removes specific Google policy folders from the system
- Deletes Chrome-related policies from the Windows registry
- Forces a Group Policy update to apply changes immediately
To run this script, follow these steps:
- Download or Copy the script content to a
.batfile (e.g.,ChromePolicyRemover.bat). - Run as Administrator: Right-click on the file and select "Run as Administrator" to ensure it has sufficient privileges to delete policies and registry entries.
Note: Running this script without administrator privileges will result in errors as it attempts to access protected system files and registry entries.
- Administrator Privileges Required: This script requires administrator privileges to modify system folders and registry entries.
- Use Caution: Removing these folders and registry keys can impact other policies or Chrome’s behavior. Be certain that these policies are safe to remove and that this action aligns with system requirements.
- Backup: Before running scripts that modify Group Policy or the registry, it is highly recommended to back up the registry and any critical data in case something goes wrong.
The script performs the following steps:
-
Close Chrome
Closes any running Chrome instances to prevent conflicts during policy removal. -
Delete Group Policy Folders
Deletes Group Policy directories (GroupPolicyandGroupPolicyUsers) if they exist. These folders may contain policies affecting Chrome. -
Delete Google Policy Directories
Removes specific Google policy directories underProgram Files (x86)andProgram Files. -
Force Group Policy Update
Executes agpupdate /forceto refresh group policies on the system. -
Delete Registry Entries
Removes Chrome-related policies from the registry under bothHKEY_LOCAL_MACHINEandHKEY_CURRENT_USER. -
Error Handling
Displays an error message if any command fails, prompting the user to ensure the script is run as an administrator.
This script is provided "as-is" without any warranty. Use it at your own risk and be aware of the implications of modifying system-level settings.
This script is intended for use in environments where Chrome policies are no longer needed or were incorrectly applied. Deleting these policies may affect other Chrome settings. Ensure compliance with your organization’s IT policies and consider consulting IT support if necessary.