Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use vbs to add a website to a secure site. Prompt when setting up a secure site to open ActiveX. The vbs code for the header and footer

Shulou Source: shulou.com Published: 2022-06-03 07:14:46 10月01日 Update

This article will explain in detail how to add a website to a secure site using vbs implementation. Prompt when setting up a secure site to open ActiveX. Go to the header and footer of the vbs code, the editor thinks it is very practical, so share it with you for reference. I hope you can get something after reading this article.

The code is as follows:

'/ * =

'* Intro mainly solves the problem that when printing with WebBrowser, you have to set IE security first.

'* FileName adds a website to a secure site. Prompt when setting up a secure site to open ActiveX. Go to the header footer. Vbs

'* /

Const HKEY_CURRENT_USER = & H80000001

Set objReg = GetObject ("winmgmts: {impersonationLevel=impersonate}!\\.\ root\ default:StdRegProv")

'add a website to a secure site

StrKeyPath = "Software\ Microsoft\ Windows\ CurrentVersion\ Internet Settings\ ZoneMap\ Domains\ yongfa365.com"

ObjReg.CreateKey HKEY_CURRENT_USER, strKeyPath

ObjReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, "http", 2

'set the security site to prompt when you open ActiveX

StrKeyPath = "Software\ Microsoft\ Windows\ CurrentVersion\ Internet Settings\ Zones\ 2"

ObjReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, "CurrentLevel", "00000000"

ObjReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, "1201", "00000001"

'cancel the header and footer

StrKeyPath = "Software\ Microsoft\ Internet Explorer\ PageSetup\"

ObjReg.SetStringValue HKEY_CURRENT_USER, strKeyPath, header, "

ObjReg.SetStringValue HKEY_CURRENT_USER, strKeyPath, footer, "

Msg = "IE security setup complete" & vbCrLf&vbCrLf

Msg = msg & "if you can't print properly, you need to close all open IE browser windows and then log in to OA to print" & vbCrLf&vbCrLf

Msg = msg & "if you still have a problem, you can contact the technical team: Liu Yongfa"

MsgBox msg, vbInformation, "warm reminder!"

On "how to use the vbs implementation to add a website to a secure site. Set up a secure site to open the ActiveX prompt. Go to the header footer of the vbs code" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.

Tags: Security site website header hint code article more question good practical warm content security technology article browser knowledge or Liu Yong Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Redmi Docker Apple Huawei