How to fix the issue that hyperlinks cannot be opened in Windows (VBScript) 

 

Introduction

This VBScript sample shows how to fix the issue that hyperlinks cannot be opened in Windows.

 

Scenarios 

Some consumers encounter an issue that when clicking on hyperlinks from emails or anywhere else, they get this message: “This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator.” so this script will help users to fix that issue.

 

Script

Step1: Double-click FixHyperlinks.vbs to run this VBScript sample. The step is shown in the following figure.

 

 

When the script finishes running, a dialog box will appear that displays brief information about the execution result of the script.

 

 

Here are some code snippets for your reference.

VB Script
Edit|Remove
Sub SetRegValue(regKey,dwValue) 
    Dim objRegistry 
    Dim strKeyPath 
    Dim strComputer 
    Dim strValueName 
    Const HKEY_CURRENT_USER = &H80000001 
     
    strComputer = "." 
    Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv") 
    'Define a key registry path 
    strKeyPath = "Software\Classes\" & regKey 
     
    objRegistry.CreateKey HKEY_CURRENT_USER, strKeyPath 
    'Sets the default string key 
    strValueName = "" 
    objRegistry.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue 
End Sub
 

 

Prerequisite

Windows 7