Batch file to change registory

Posted on 2011-09-18
Medium Priority
Last Modified: 2012-06-27
Hello Experts,

How to write a batch file for changing Registry value, and I want to do that under AC GPO, when user login the batch file should run

for example if I want to change following:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Google\Google Toolbar\GoogleUpdate]


Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Google\Google Toolbar\GoogleUpdate]

Question by:uknet80
  • 2

Accepted Solution

bloodygonzo earned 1000 total points
ID: 36556220
Paste the information into notepad and save it as timestamp.reg

Place the reg file on a share that can be accessed my the GPO.

Your reg file should contain

@echo off

Regedit /s \\path\to\timestamp.reg

Exit /b 0

You can check out ss64.com/nt/regedit.html for more info.
LVL 72

Assisted Solution

Qlemo earned 1000 total points
ID: 36556512
If you have single registry changes only, instead of a complete set, it usually is much easier to just code that into the batch:
@echo off
reg add "HKCU\Software\Google\Google Toolbar\GoogleUpdate" /v InstallTimestamp /t Reg_DWord /d tttttt /f

Open in new window

That allows for e.g. checking for specific values, adding some value, aso.
Regarding execution, just put the script into the NetLogon share and create an entry in GPO for Login pointing to the batch.

Author Comment

ID: 36579673
I create .bat file and pasted your code, double clicked the file but registry hasn't changed?

Author Closing Comment

ID: 36719545

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
Seizing the Operation Master Roles in Windows Server 2016 in case of FSMO holder failure.
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.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

624 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