Find string, insert one after (batch)

March 2, 2011 at 16:34:41
Specs: Windows XP
Hi all,

I've spent a few hours with For loops and all sorts of things (using all the examples I can find on this site), but can't get a satisfactory result (mostly to do with the characters I'm trying to find and replace, I think).

I have a registry file that looks like this:

================================

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Valve\Steam\Apps]

[HKEY_CURRENT_USER\Software\Valve\Steam\Apps\10]
"userconfigcrc"=dword:146d9867

[HKEY_CURRENT_USER\Software\Valve\Steam\Apps\10090]
"userconfigcrc"=dword:dbc74023

[HKEY_CURRENT_USER\Software\Valve\Steam\Apps\10150]
"userconfigcrc"=dword:dbc74023

[HKEY_CURRENT_USER\Software\Valve\Steam\Apps\10500]
"userconfigcrc"=dword:dbc74023

=======================

What I'd like to do is insert the string

"EnableCacheLoading"=dword:00000001

Under each line that ends with ]. How would I achieve this using only inbuilt command line stuff (no external programs)?

Extra bonus points if it doesn't insert the line under the HKEY_CURRENT_USER\Software\Valve\Steam\Apps key ;)


See More: Find string, insert one after (batch)

Report •


#1
March 2, 2011 at 17:24:56
Found an alternative way to achieve what I wanted to do (using reg.exe add) -- thanks anyway!

Report •
Related Solutions


Ask Question