Solved

vbScript to edit the registry

Posted on 2010-09-19
4
968 Views
Last Modified: 2012-06-27
I want to change the value of -

'HKEY_CURRENT_USER\Software\Microsoft\Office\12\Access\Security\VBAWarnings'

to a value of 1.

It has to be vbScript.

Can anyone help please.
0
Comment
Question by:djk001
[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 65

Accepted Solution

by:
RobSampson earned 250 total points
ID: 33713649
Hi, this should work.

Regards,

Rob.
Set objShell = CreateObject("WScript.Shell")
objShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\12\Access\Security\VBAWarnings", 1, "REG_DWORD"

Open in new window

0
 
LVL 5

Expert Comment

by:rvivek_2002
ID: 33713710

Option Explicit
Dim objShell, strRoot, strModify, strDelete
strRoot = "HKEY_CURRENT_USER\Software\Microsoft\Office\12\Access\Security\VBAWarnings"
' Create the Shell object
Set objShell = CreateObject("WScript.Shell")
strModify = objShell.RegWrite(strRoot,"00000001", "REG_DWORD")
strModify = null
WScript.Quit
0
 

Author Comment

by:djk001
ID: 33713751
Hi Rob
That has worked a treat.  It's clean, simple and short.  Thank you.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 33713753
No problem. Thanks for the grade.

Rob.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 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