Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


December 1997

New Ways to Mine the Registry


RSS
Subscribe to Windows IT Pro | See More Registry Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Editing the Registry on Multiple Computers
To make Registry changes to several computers across the network, you can use the System Policy Editor (SPE) to create policies that download to each computer as it logs on to the network. (For information on SPE, see Related Articles in Windows NT Magazine.) You can also use Regedit's import feature as a low-tech alternative to the SPE. For example, if you want to change a specific Registry setting on multiple computers, you can create a Registry data file with the new setting and import it on each computer you want to modify. In Clayton Johnson's, "Installing Applications Across the Network," April 1997, the author suggests that you use a share that anybody on the network can connect to and install optional software from. This approach requires that you visit each workstation and add a new value (AppInstallPath) to the Registry before the user can take advantage of the share. You can create a .reg file with the new value and place it on the share. The first time a workstation connects to the share, the user imports the Registry file, which enables the network installation feature on the user's computer.

For the example in Clayton Johnson's article, you need to add the AppInstallPath value to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion key. Following the instructions in the article, edit the Registry, add the value, and give it the path of the Apps.inf file. Then use Regedit to export the Registry key to a file. The file will look similar to the following:

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion]

"DevicePath"=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,69,6e,66,00

"MediaPathUnexpanded"=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,4d,65,64,

69,61,00

"ProgramFilesDir"="D:\\Program Files"

"CommonFilesDir"="D:\\Program Files\\Common Files"

"MediaPath"="D:\\WINNT\\Media"

"AppInstallPath"="\\\\server1\\winnt\\inf\\apps.inf"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths]

...

Using a text editor, remove everything from the file except REGEDIT4, the first key, and the AppInstallPath items. This step will leave you with just the following:

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion]

"AppInstallPath"="\\\\server1\\winnt\\inf\\apps.inf"

The file now contains only the new entry, so NT won't overwrite any existing entries when you import the file. The [HKEY...] line simply identifies the right location for the new entry.

Name this file something intuitive, such as Appinst.reg, and place it on the share you are using for software distribution. Create a batch file that runs Regedit on the .reg file. For example, Appinst.bat could contain regedit/s appinst.reg. Now when users want to enable their workstation for the network software installation, all they have to do is go to the network share and run Appinst. This approach is a vast improvement over visiting each workstation and editing the Registry by hand.

Registry Editing Over the Web
You can also use a Web browser to edit the Registry, but this practice can be risky. If someone maliciously or accidentally causes your Web browser to import a Registry file, that user can corrupt or compromise your system. Listing 1, page 178, shows HTML that uses links to the Registry scripts I created earlier.

After I created the HTML, I selected the Programs tab from Options under the View menu in Internet Explorer (IE) to designate Regedit as a viewer for .reg files. I set the action to be Open with the application command line set to C:\Winnt\Regedit.exe /s "%1". When you view the HTML file and double-click the link, the Web server downloads the .reg file to the Web browser, which runs Regedit on the file (%1). Screen 1 shows the HTLM page in IE. Obviously, this example is not the most sophisticated HTML front end to the Registry, but it demonstrates some powerful features.

Never leave your Web browser configured this way when you're browsing the Internet, but this method has possibilities for intranet use. For example, you can create a Web page that lets your remote NT users make Registry edits on their machines simply by going to your Web site, reading the instructions, and clicking a few buttons.

If you are administering NT computers in a complex production environment, you'll want to develop some tools for making Registry changes in a safe and efficient manner. You have several choices mining the NT Registry.

End of Article

   Previous  1  2  [3]  Next  


Reader Comments

You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

WinInfo Short Takes: Week of November 23, 2009

An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...


Related Events Deep Dive into Windows Server 2008 R2 presented by John Savill

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement