I need to find all the subkeys with a specific value say C:\users\108736 then change that value to c:\users\108735

my real issue is I have to remove folder redirection on all my users machines so I need to change all the registry values that point to remote drives to point back to local I have the script 90% complete but the are some random registry keys I need to find and change with the script

So you need to search the entire registry to do this? That’s going to be massively impractical.

But, it isn’t syntactically difficult. In pseudo-code…

Get-ChildItem HKCU:\Whatever\Starting\Kay -Recurse |
ForEach {

Get the item properties |

Where value -like ‘whatever’ |

That’s very obviously not running code, but it’s the basic logic you could start with. Get all the keys, enumerate them. For each one, key its properties. For each of those, see which ones have a value you care about, and change the value.

Not gonna lie. Isn’t going to be quick.

yup I ditched the idea. I just opted to change the main keys that impact production the other key like MSoffice History will be cleared manually. my new issue is how to reset the ACL on the files when I move them back from the cached folder to there profile.

I’d probably rely on Robocopy for that. If you actually let it strip the ACL from the file, it’ll inherit the ACL of the destination folder. That is, I believe, its default behavior.

im using Robocopy but it is keeping the ACL am I doing it wrong

Robocopy "C:\WINDOWS\CSC\v2.0.6\namespace\” “C:\users\” /E /COPYALL /ZB /R:0

Well, you’re saying /COPYALL. That includes the ACL. So, don’t do that. Maybe you’re after /COPY:DATOU, which omits the ACL - but I’m not sure what else you mean to copy.

ok i will try

Don that worked I’m leaving you in my will thanks man