ActiveX control and using it in Javascript & Vbscript to add key value in the Registry.

ActiveX is a client-side technology only. It is designed to allow COM objects registered on the client machine to be instantiated in the browser. ActiveX controls can be used in clientside applications running in a web browser. When the user accesses a web page, the control is downloaded to the client machine and is run from the browser using a scripting language such as Javascript or VBScript.

Ex: To uncheck delete browsing history on exit checkbox in IE


<script language=”javascript” type=”text/javascript”>
function Prevent() {

try {
var wsh = new ActiveXObject(“WScript.Shell”);
var key = “HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Privacy\\ClearBrowsingHistoryOnExit”;
wsh.RegWrite(key, 0, “REG_DWORD”);
alert(“Disabled delete browsing history on exit.”);
catch (e) {
alert(“Delete browsing history on exit is not enabled.”);
<body onload=”Prevent()”>


In Vbscript:

<script type=”text/javascript”> var foobar = false; </script>  //Important since javascript is there by default.
<script type=”text/vbscript”>
sub testmePlease()
s_RegPath=”HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Privacy\ClearBrowsingHistoryOnExit”
set o_WScript=createobject(“”)
o_WScript.RegWrite s_RegPath,1,”REG_DWORD”
set o_WScript=nothing
end sub


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s