Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identifying and Changing Registry Keys 3

Status
Not open for further replies.

Tech4U

MIS
Feb 26, 2002
37
US
I was just asked by my boss to create an app to go into the registry, make it look at certain keys and their values, and if it is not what it is supposed to be then change it. Does anyone know how this can be done? VB, SMS, MSI, REG?

Thanks! and please let me know if you have questions.

T





 
Click Start
Click Run
Type Regedit and hit enter.

Strator
 
Ummm.....very incisive of you, but I'm more interested of automating the process. Doing this manually on thousands of machines probably wouldn't really justify the time it would take. Thanks anyway. Next....

T
 
Are you always making the same changes? So it wouldn't matter if keys were already correct, and you just overwrite with same values - or does change depend on current value?

If the first, you could just create an import script for regedit containing all the correct values (eg REGEDIT /S SCRIPT.REG), where Script.reg was for example:-

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Start Page"="
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main]
"Default_Page_URL"="
[HKEY_USERS\.Default\Software\Microsoft\Internet Explorer\Main]
"Start Page"="
If the second, I have no real ideas currently (registry export, automated replace on export, then registry import)?
 
Yep, that's the right way...just type "regedit" from your Start menu > Run...if editing the registry isn't something you've done before, I wouldn't suggest doing it until you've made a backup of the registry files first.
 
Set up 1 pc manually with all the registry values you want, then from regedit use the export option on the registry menu, set the export range to selected branch and export it to a file. This will create a ???.reg file with the keys you wanted (as regedit exports whole branches you may want to manually edit this afterwards, and if you want keys from multiple branches, export each one separately and merge the resulting .reg files)
If you double click a .reg file it's contents will be added to the registry - overwriting any existing keys with the same name, you can also merge the .reg file from a batch file.
<< JOC >>
 
Thank you for your input Wolluf and Jocsta!

I'm not sure what exactly my boss wants me to do. I mentioned that we could just create a reg import file to be used and then put it in MSI format for AD, but then he wanted to do it by looking at the current values and then making the changes after finding out whether they needed to be done or not. So that was my main reason for coming out to the forums. I think that after what I have gotten here, I will just tell that the changes will have to be made regardless of the current value.

Thank you both again!

T
 
I have played with VB scripting a tiny tiny bit and you can access the registry, examine values and write values.

I think you will need to find someone to write the script for you or get a book and write your own. I would suspect that if you have a college near by, you can find a kid who will whip it out for a couple of beers and $100.

HTH
 
Ok...after looking into some apps that I currently have, I found that this can very easily be done using SMS Installer. Basically, you can set it up to do registry checks to see if the value equals, is less than, or greater than what you need and then create if/then statements. You can also set it up to open dialog boxes to let the user know if it is correct or not. Then you can just save it as a SMS Installer file (IPF) and use a 3rd party program like Winbatch to create an MSI file out of it. That way it can be put out in add/remove programs using Active Directory. So after a little digging I got it.

So thank you all for your suggestions and help!

T
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top