Solved

vbScript to edit the registry

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Welcome to part one of a multi-part tutorial series, VBScript for Windows System Administrators.  The goal of this series is to teach non-programmers how to write useful VBS code to automate their environment, and perform tasks faster, and in a more…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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