Solved

# Batch file to change registory

Posted on 2011-09-18
Medium Priority
504 Views
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

"InstallTimestamp"=dword:4d60a755

To

Windows Registry Editor Version 5.00

"InstallTimestamp"=dword:tttttt

thanks
0
Question by:uknet80
• 2

LVL 4

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.

@echo off

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

Exit /b 0

0

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

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.
0

Author Comment

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

Author Closing Comment

ID: 36719545
thanks
0

## Featured Post

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.

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…
###### Suggested Courses
Course of the Month8 days, 10 hours left to enroll