Solved

vbScript to edit the registry

Posted on 2010-09-19
4
966 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
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

820 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