0

I have this Code to check if a registry Code is avaible and if not, make a new one and save it.

public static string CheckForRegistryGuid()
    {
        string id = (string)Registry.LocalMachine.GetValue(@"SOFTWARE\mySoftware", "Guid");

        if(id == "Guid")
        {
            id = Guid.NewGuid().ToString();

            RegistryKey key = Registry.LocalMachine.OpenSubKey("Software", true);

            key.CreateSubKey("mySoftware");
            key = key.OpenSubKey("mySoftware", true);

            key.SetValue("Guid", id);

            return id;
        }
        else
        {
            return id;
        }
    }

Now my Problem is that If I dont find a key, a new one is saved BUT you can only see it on "C:\Windows\SysWOW64\regedit.exe" like here explained.

But know if I want to read the key again it cant be found.

How can I read and write an entry that works on 32 bit and 64 bit Windows Systems?

SomePerson
  • 581
  • 1
  • 6
  • 18
  • I am not really sure what is the problem. Typically you would read/write registry from your software, why do want to use regedit.exe? To check what is there? Maybe [this one](https://stackoverflow.com/q/15424205/1997232) or [this one](https://stackoverflow.com/q/974038/1997232) is helpful? – Sinatr Dec 20 '18 at 11:17
  • Thats what I want, but my Software saves this entry not in the right "path". I cant even see the entry with the normal regedit but eith the Version in the syswow64 Folder. The Problem is that my Software dont find this entry too. – SomePerson Dec 20 '18 at 13:08

0 Answers0