Ram Shankar Yadav's Blog!

My life's my passion!
posts - 165, comments - 361, trackbacks - 91

My Links

News


Microsoft Certified Professional Developer (MCPD) - .NET 2.0 Enterprise Application Development



Cheap Website Hosting - Free Domain

Twitter












Archives

Post Categories

Image Galleries

Blogs that I like most !

Sites that I like most !

Windows Registry Command Line Manuplation

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


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

Feedback

Gravatar

# re: Windows Registry Command Line Manuplation

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.
5/3/2006 6:59 AM | Random Reader
Gravatar

# re: Windows Registry Command Line Manuplation

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!
5/4/2006 10:24 AM | Ram Shankar Yadav
Gravatar

# re: Windows Registry Command Line Manuplation

Thanks a lot man! u saved me huge amount of time with this solution !
3/3/2008 12:19 PM | Nilesh
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: