Changing registry keys via VBS from GPO

Posted on 2004-11-24
Medium Priority
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
  • 2
LVL 26

Accepted Solution

EDDYKT earned 150 total points
ID: 12674213
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

ID: 12678464
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

ID: 12678739
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

Industry Leaders: 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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

850 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