Solved

batch file registry change

Posted on 2011-03-09
4
976 Views
Last Modified: 2012-05-11
I need to create a batch file that makes a registry change. The reg change is this:

Locate and then select the following subkey in the registry:
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Options\Calendar
On the Edit menu, point to New, and then click DWORD Value.
Type EnableDirectBooking, and then press ENTER.
Right-click EnableDirectBooking, and then click Modify.
In the Value data box, type 1, and then click OK.

reference: http://support.microsoft.com/kb/982774

The goal is to create a batch that techs can execute to make the reg change. Thxs
0
Comment
Question by:DEFclub
4 Comments
 
LVL 16

Accepted Solution

by:
sjklein42 earned 500 total points
ID: 35085897
Set up the registry key just the way you want it in one machine's registry.

Then, right-click on that entry (in regedit) and select Export.  Save the "reg" file somewhere.

Distribute the "reg" file.

Subsequently, double-clicking on the new "reg" file will add the registry entry to a machine.
0
 

Author Closing Comment

by:DEFclub
ID: 35085917
ahh thats right - thxs
0
 
LVL 7

Expert Comment

by:Rommel Sultan
ID: 35085958
Heres a vbs might help you
const HKEY_CURRENT_USER = &H80000001
sComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & sComputer & "\root\default:StdRegProv")
sKeyPath = "Software\Microsoft\Office\14.0\Outlook\Options\Calendar"
oReg.CreateKey HKEY_CURRENT_USER,sKeyPath
sValueName = "EnableDirectBooking"
dwValue = 1
oReg.SetDWORDValue HKEY_CURRENT_USER,sKeyPath,sValueName,dwValue

Open in new window

0
 
LVL 4

Expert Comment

by:Joseph Ruiz
ID: 35086115
Just take this but of code and save it to a batch file:
reg add HKCU\Software\Microsoft\Office\14.0\Outlook\Options\Calendar /v EnableDirectBooking /t REG_DWORD /d 1

Open in new window


Here are instructuins on how to make more:
Console Registry Tool for Windows - version 3.0
Copyright (C) Microsoft Corp. 1981-2001.  All rights reserved

REG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/f]

  KeyName  [\\Machine\]FullKey
           Machine  Name of remote machine - omitting defaults to the current
                    machine Only HKLM and HKU are available on remote machines
           FullKey  ROOTKEY\SubKey
           ROOTKEY  [ HKLM | HKCU | HKCR | HKU | HKCC ]
           SubKey   The full name of a registry key under the selected ROOTKEY

  /v       The value name, under the selected Key, to add

  /ve      adds an empty value name <no name> for the key

  /t       RegKey data types
           [ REG_SZ    | REG_MULTI_SZ  | REG_DWORD_BIG_ENDIAN    |
             REG_DWORD | REG_BINARY    | REG_DWORD_LITTLE_ENDIAN |
             REG_NONE  | REG_EXPAND_SZ ]
           If omitted, REG_SZ is assumed

  /s       Specify one charactor that you use as the separator in your data
           string for REG_MULTI_SZ. If omitted, use "\0" as the separator

  /d       The data to assign to the registry ValueName being added

  /f       Force overwriting the existing registry entry without prompt

Examples:

  REG ADD \\ABC\HKLM\Software\MyCo
    Adds a key HKLM\Software\MyCo on remote machine ABC

  REG ADD HKLM\Software\MyCo /v Data /t REG_BINARY /d fe340ead
    Adds a value (name: Data, type: REG_BINARY, data: fe340ead)

  REG ADD HKLM\Software\MyCo /v MRU /t REG_MULTI_SZ /d fax\0mail
    Adds a value (name: MRU, type: REG_MUTLI_SZ, data: fax\0mail\0\0)

  REG ADD HKLM\Software\MyCo /v Path /t REG_EXPAND_SZ /d %%systemroot%%
    Adds a value (name: Path, type: REG_EXPAND_SZ, data: %systemroot%)
    Notice:  Use the double percentage ( %% ) inside the expand string

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

This script checks a path to see if a folder exists. If the folder does exist you will get output "The folder has previously been created. No action taken" If not it will create the folder. Then adds one user modify permission to the folder. It …
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 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

10 Experts available now in Live!

Get 1:1 Help Now