The Windows Learning Center

How to Use the Group Policy Editor (Gpedit.msc) in Windows 7 and 8


The Group Policy Editor is a management console, gpedit.msc, that provides convenient configuration of many system properties and for running scripts. How to open and use it is described and an example of runnng a script at shutdown is given.

What the Group Policy Editor (GPE) Does

GPE is a powerful Microsoft Management Console that provides a way to modify a variety of Registry settings in a convenient way. The modifications are done by applying what are known as policies. Policies affect how specific Windows Registry settings behave without having to directly edit the Registry. Policies are stored in a special hidden folder %SystemRoot%\System32\GroupPolicy\. However, these files are not accessed directly but are used by the GPE interface to read, create, or configure the policies that are found there.

GPE is used extensively by systems administrators and is very useful in administering networks with multiple machines. However, GPE is also quite useful for single users and I will discuss how a home user of Windows 7 or 8 can take advantage of this powerful system tool.

A previous article discusses using GPE in Windows XP.

Unfortunately, GPE is not available in Home versions of Windows.

How to Open Group Policy Editor

Using GPE requires administator privileges. GPE is not listed in the programs menu but can be opened in these ways:

  • Windows 7 - Open the Start menu and in the Search box, enter "gpedit.msc" (without quotes).
  • Windows 7 or 8 - Open the Run box with the keyboard shortcut Winkey+R. Then enter "gpedit.msc" (without quotes).

These procedures open what is known as the Local Group Policy Editor (Example shown in Figure 1). Settings done here apply to all users. It is also possible to create a custom console that can apply settings to specific users. This capabiity was not present in Windows XP and was introduced with Vista. The procedure is described at this Microsoft page.

Figure 1. Local Group Policy Editor
Local Group Policy Editor in Windows 8

Using the Group Policy Editor

As Figure 1 shows, GPE has two main branches - Computer Configuration and User Configuration. In broad terms, settings in Computer Configuration apply to the overall machine settings and settings in User Configuration apply to the current user. There are several hundred settings and the best way to see what can be done is to scroll through all the settings. You can also download a spreadsheet from Microsoft at this link that lists all the settings.

Figure 2 shows a partial display of the available settings for User Configuration in Windows 7 Professional. Windows 8 has a somewhat different list although the interface is identical. The list is opened by clicking User Configuration-Administrative Templates-All Settings in the left pane.

Figure 2. List of All User Configuration settings
List of settings in Windows 7

There are numerous tweaks possible using GPE and many are discussed on the Internet. More information can be found at this Microsoft link.

A Useful Example of Using the Group Policy Editor

GPE can also be used to run scripts at start up, shut down, or at log on/off. There are various ways to run scripts at start up or log on but not so many for shutdown or log off. As Figure 3 shows, a script can be run when the system is shut down or when the user logs off. For example, to run a script at shutdown, go to Computer Configuration in the left pane, click Windows Settings - Scripts (Startup/Shutdown). The right pane will then show the entries shown in Figure 3. Click "Shutdown" and the dialog shown in Figure 4 will open.

Figure 3. Using Group Policy Editor to run scripts
Start up and shut down scripts

Figure 4 shows the interface for entering whatever scripts you wish to run before a computer shuts down.

Figure 4. Configuring a script to run at shutdown
Configure shutdown script

To add a script that is to be run at shut down, click the "Add" button and the dialog shown in Figure 5 will open. The scripts can be any executable and can be stored anywhere. However, it is convenient to place them in a place that is already set aside at %SystemRoot%\System32\GroupPolicy\\Machine\Scripts\Shutdown

Figure 5. Adding a script
Adding a script in GPE

More about running scripts can be found at this Microsoft page.