Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

batch file registry change

Posted on 2011-03-09
4
Medium Priority
?
981 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 2000 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

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

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

The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Screencast - Getting to Know the Pipeline

877 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