Search into Windows registry with grep/cygwin

0

I'm trying to search and remove unrelevantregistry keys, and it sounds like Cygwin does allow access to them through /proc/registry.

However, recursive grep -r (2.21) outputs error lines like :

grep: /proc/registry/HKEY_CLASSES_ROOT/.aspx/@: Is a directory

Strange error for a recursive grep. Then, file displays :

$ file /proc/registry/HKEY_CLASSES_ROOT/.aspx/@
/proc/registry/HKEY_CLASSES_ROOT/.aspx/@: ASCII text, with no line terminators

So it's a file now. I used cat.

$ cat /proc/registry/HKEY_CLASSES_ROOT/.aspx/@
VisualStudio.aspx.10.0

And I can't cd into it, moreover ls -l doesn't display the d flags. Why grep still considers it as being a directory ?

Amessihel

Posted 2016-02-19T14:03:46.240

Reputation: 163

Using cygwin to edit the registry seems a bit risky. It can mess up file permissions and ownership etc. so I don't know what this might do to registry files. Is there some reason why the regular regedit utility won't do what you need? – user1751825 – 2016-02-19T14:11:55.490

regedit’s search capabilities are rather limited. That being said, this is an interesting issue, especially since find -type f works as expected. – Daniel B – 2016-02-19T14:13:40.700

1Hmm. What is the @ supposed to represent? cd /proc/registry/HKEY_CLASSES_ROOT/.aspx followed by ls works for me. – DavidPostill – 2016-02-19T14:16:51.983

1What is the exact grep command you are using? – DavidPostill – 2016-02-19T14:20:35.390

@DavidPostill : grep -r string /proc/registry. Updated my question to added the version. Also cd /proc/.../.aspx then ls shows @ among other entries. – Amessihel – 2016-02-19T14:23:12.253

What "string" are you searching for? I'm trying to reproduce your issue :/ – DavidPostill – 2016-02-19T14:25:06.240

@DavidPostill A custom one... tmp-build – Amessihel – 2016-02-19T14:29:42.927

Answers

0

My understamding is that cygwin's registry support is somewhat experimental. You're not looking at regular files and folders, but rather a kind of simulated directory structure. I'd be very surprised if utilities like grep would behave correctly in there.

You'd likely have a lot more success with powershell, and it won't have any of the limitations of regedit.

user1751825

Posted 2016-02-19T14:03:46.240

Reputation: 846