Changing registry keys via VBS from GPO

Posted on 2004-11-24
Last Modified: 2011-04-14
Hi all,

I need to update/change some settings in MS word on client's pcs.  Now I don't think such settings exist in GPO in W2k server.

Though, I have found these settings in the registry on local machine.  I need to update these settings and make it VBS so that it executes during log in process on client's pcs.

What would the command look like for this?

I need to change HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\General\

and the key is SharedTemplates = c:\blah blah  to  I:\server

and HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\Options

Startup-path = c:\blah to I:\server

Question by:cooljam23
    LVL 26

    Accepted Solution

    Dim Win32Script As Object

    Set Win32Script = CreateObject("WScript.Shell")

    Win32Script.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\General\SharedTemplates", "I:\server"
    Win32Script.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\Options
    \Startup-path ", "I:\server"

    Set Win32Script = nothing

    Author Comment

    didn't really work.  I got the error message when logging in.

    but I used this instead

    set sh = WScript.CreateObject("WScript.Shell")
    sh.RegWrite "reg key", "new value"

    and that worked.

    thanks anyway


    Author Comment

    here's another question.  

    i need to copy a file from the server to workstation


    I have posted this question before and noone was able to help

    I had issues with permissions that the file from server cannot be copied to c:\windows\system32

    see if you can help me.  i'll post a new question

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

    745 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

    19 Experts available now in Live!

    Get 1:1 Help Now