Solved

vbScript to edit the registry

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Unlike scripting languages such as C# where a semi-colon is used to indicate the end of a command, Microsoft's VBScript language relies on line breaks to determine when a command begins and ends. As you can imagine, this quickly results in messy cod…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now