Ram Shankar Yadav's Blog!

My life's my passion!

  Home  |   Contact  |   Syndication    |   Login
  157 Posts | 0 Stories | 308 Comments | 95 Trackbacks

News


Microsoft Certified Technology Specialist ( MCTS) - .NET 2.0 Windows Development
Microsoft Certified Professional

My Photo Ablum


Cheap Website Hosting - Free Domain

Archives

Post Categories

Image Galleries

Blogs that I like most !

Sites that I like most !

The image “http://labmice.techtarget.com/images/regedit.gif” cannot be displayed, because it contains errors.Monday morning and a new assignment : “Create a batch file to update registry and restart IIS”

So I started googling to get the solution of the first, i.e., Updating registry entries by command line. This can be done in two ways:

  • Command Line Tool like Reg, RegFind, etc.
  • Creating a .reg file and calling this using RegEdit command line options.

Tools like Reg and RegFind provided with Windows 2000 Resource Kit, but in my case I have to do it using existing tools like RegEdit or RegEdt32.
So we have to proceed with second option, following are the steps to my solution:

1. Create a .reg file, my reg file looks like this:


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Test]
"TestValue"="New Test Value"


2. Create a .bat file, my bat file look like this:


@echo off
echo Registry Values set

regedt32 /s test.reg

echo Restarting IIS

iisreset

echo "Done"

@echo on


, as the solution for the second one is quite easy i.e., IISreset which restarts IIS.

Now everything is set and done just either double click the .bat file or schedule it. In the links sections I'm posting the links which helped me to achive this.

Links:


Windows Registry (Wikipedia: Everything about Windows Registry, pros & cons, and how to's!)

How to add, modify, or delete registry subkeys and values by using a registration entries (.reg) file (recommended)

Viewing and Manipulating the Registry (recommended, a comprehensive tutorial)

Regedit Command Line Options Syntax


posted on Monday, May 01, 2006 10:27 AM

Feedback

# re: Windows Registry Command Line Manuplation 5/3/2006 6:59 AM Random Reader
The reg.exe command line tool is actually included with the Support Tools on the 2000 CD, and part of the base install for XP. Depending on what constitutes "existing tools" for your environment, it might be usable.

# re: Windows Registry Command Line Manuplation 5/4/2006 10:24 AM Ram Shankar Yadav
Hey buddy, you are right but my requriemnt does not suffice this solution. As we have no control over the servers. That's why I choosen the above solution.
If anybody has a better solution, I'm open!

# re: Windows Registry Command Line Manuplation 3/3/2008 12:19 PM Nilesh
Thanks a lot man! u saved me huge amount of time with this solution !

Post Feedback

Title:
Name:
Email: (never displayed)
Url:
Comments: 
Please add 2 and 5 and type the answer here: