[PS] Replacing an string with another string in the entries values of registry
HI
I have some registry key containing some entries of various formarts
I have to analyze only the REG_SZ values of the entries in these keys to find if a specific string is included in (not equal to) these values to replace this string with another string.
So how do I do this?
THANKS
BYE
I have some registry key containing some entries of various formarts
I have to analyze only the REG_SZ values of the entries in these keys to find if a specific string is included in (not equal to) these values to replace this string with another string.
So how do I do this?
THANKS
BYE
0 Comments
[ + ] Show comments
Answers (5)
Please log in to answer
Posted by:
anonymous_9363
14 years ago
You could do worse than start here.
Heard of Google, BTW? It was all I could do to resist sending the link above as a LMGTFY one...
Heard of Google, BTW? It was all I could do to resist sending the link above as a LMGTFY one...
Posted by:
anonymous_9363
14 years ago
Posted by:
balubeto
14 years ago
So if I write:
I reach my goal?
THANKS
BYE
param($Key,$findval,$repval)
function RepEntryValue ($Key,$findval,$repval)
{
$GetKey = Get-Item $Key
$prop = Get-Itemproperty $GetKey.pspath
$strprops = @{}
$strprops = $GetKey.property | where { $prop.$_.gettype().name -eq "String"}
$strprops | $_ -replace $findval $repval
}
RepEntryValue -Key 'Key analyzed' -findval 'Value searched' -repval 'Value replaced'
I reach my goal?
THANKS
BYE
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.