Solved

batch file registry change

Posted on 2011-03-09
4
974 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:Xiurzeph
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

760 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

22 Experts available now in Live!

Get 1:1 Help Now