View Full Version : Rename a Registry Key from a Batch, INF, or REG file...
cjsdelray
04-17-2000, 04:48 PM
I need to rename a specific registry key for a moment, make a change, then rename the key to it's original state. This is easy enough to do. However, I need to do this automatically. I need to be able to accomplish this from an INF, Batch file, or a REG file.
I have searched very thoroughly through the posts on this site and they have helped me extensively. But I am still unable to find the answer to this particular question. I have searched through Microsoft's site, and among many internet sites, but have found nothing.
Hopefully someone out there will know the answer to this.
Thanks,
Chad J. Sanders
You can create a reg file that does what you need it to do, then put it in a batch file with a /s after the name of the *.reg file. /s = silent mode and you won't be querried to make an entry or change in the registry.
Option 2 maybe; If you have Windows 98 look at Windows Scripting Host. An example should exist on your hard drive at Windows\samples\WSH\registry.vbs
This is a little fancier and may require some programming in visual basic to customize these examples to your needs. The registry example creates registry keys, subkeys, and values, then it deletes each one it has created. By inserting a ' in front of the lines that say WSHShell.Popup the visual basic OK box won't pop up and will execute the next command (modifying the registry).
jstolz
04-18-2000, 11:57 PM
I don't think the reg file will do the trick--the problem is in renaming the key. Exporting the key is easy enough, but renaming the key requires some pretty sophisticated filtering of the DOS find key, redirection to another file, and stripping carriage returns--except of course you had some kind of DOS search/replace tool.
The Scripting host may be the way to go.
Regards...
mike_2
04-20-2000, 04:24 PM
win95rk.hlp on the Windows 95 cd
(D:\admin\reskit\helpfile\win95rk.hlp) has
information on how to write a .inf file.
I hope this helps..
Powered by vBulletin™ Version 4.1.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.