How to add the “Pin to Start Screen” context menu item to all files in Windows 8.1 (VBScript)

Introduction

This VBscript sample shows how to add the “Pin to Start Screen” context menu item to all files in Windows 8.1

Scenarios

With Windows 8.1, Microsoft has restricted access to the 'Pin to Start Screen' menu command for 3rd party apps. The same thing could be implemented in Windows 8, any app was able to pin itself to the Start Screen, but not so in Windows 8.1. So this script can get the "Pin to Start Screen" context menu item unlocked for every file, and every file system object in Explorer.

Note

This script can help you to modify the registry automatically. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base: 322756 (How to back up and restore the registry in Windows)

Script

Step 1: You can run this VBScript sample by simply double-clicking.

The step is shown in the following figure.

When the script finishes running, it will spawn a window that displays brief information about the result.

As you can see, the “Pin to Start” item has been added to context menu successfully.

 

Here are some code snippets for your references.

VB Script
Edit|Remove
Sub addItemContextMenu(strKeyPath) 
Dim strComputer,objRegistry,strValueName,dwValue 
    Const HKEY_CURRENT_USER = &H80000001 
    strComputer = "." 
     
    Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv") 
    objRegistry.CreateKey HKEY_CURRENT_USER, strKeyPath 
     
    strValueName = "" 
    dwValue = "{470C0EBD-5D73-4d58-9CED-E91E22E23282}" 
     
    objRegistry.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue 
End Sub