Solved

batch file registry change

Posted on 2011-03-09
4
975 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

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

Question has a verified solution.

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

Microsoft Windows Server Update Service (WSUS) is free for everyone, but it lacks of some desirable features like send an e-mail to the administrator with the status of all computers on the WSUS server. This article is based on my PowerShell script …
A procedure for exporting installed hotfix details of remote computers using powershell
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

920 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

17 Experts available now in Live!

Get 1:1 Help Now