[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

VBS Script that will write to the registry

Posted on 2013-06-06
4
Medium Priority
?
405 Views
Last Modified: 2013-06-07
I need a quick vbs script that will write to the registry.  Since regedit is blocked on user machines I need to run this using a vbs script.  I appreciate the feedback!

HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\AdobeViewer
Value Name = TrustedMode
Value Data = 0
Reg_DWord

HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\Security\cPPKHandler
Value Name = bCustomPrefsCreated
Value Data = 1
Reg_DWord
0
Comment
Question by:mystikal1000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 42

Accepted Solution

by:
Meir Rivkin earned 2000 total points
ID: 39225273
Const HKEY_CURRENT_USER = &H80000001

strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strKeyPath = "Software\Adobe\Acrobat Reader\11.0\AdobeViewer"
strValueName = "TrustedMode"
dwValue = 0
objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue

strKeyPath = "Software\Adobe\Acrobat Reader\11.0\Security\cPPKHandler"
strValueName = "bCustomPrefsCreated"
dwValue = 1
objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue

 

Open in new window

0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39225308
Dim objFSO, WshShell

Set WshShell = WScript.CreateObject("WScript.Shell")
set objFSO = CreateObject("Scripting.FileSystemObject")

WriteReg "HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\AdobeViewer\TrustedMode", "0", "REG_DWORD"
WriteReg "HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\Security\cPPKHandler\bCustomPrefsCreated", "1", "REG_DWORD"

Sub WriteReg(strKey, strValue, strType)
	WshShell.RegWrite strKey, strValue, strType   
End Sub

If Err.Number<>0 Then    
	MsgBox "Error #" & Err.Number & " " & Err.Source & " " & Err.Description
End If

set WshShell = Nothing

Open in new window

0
 
LVL 1

Author Comment

by:mystikal1000
ID: 39225437
Sedgwick

How do I create an another reg key called Security and Excludes via VBS?
Software\Adobe\Acrobat Reader\11.0\AdobeViewer\Security\Excludes

I appreciate your quick response! Thanks
0
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 39225444
objRegistry.CreateKey HKEY_CURRENT_USER, "Software\Adobe\Acrobat Reader\11.0\AdobeViewer\Security\Excludes"

Open in new window

0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
Simple Linear Regression

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question