Click here to Skip to main content
15,885,757 members
Everything / Registry

Registry

registry

Great Reads

by Amir Mohammad Nasrollahi
How to list the installed applications of your system and their setup details in C# language
by Michael Chourdakis
A simple template for manipulating the registry
by Avelino Ferreira
"Don't care about Google Maps/Routing/StreetView programming. This Control gives your WinForms applications the power of Google Maps API v3". - my previous article. Unfortunately, since Dec.2015, Google Maps JavaScript API applications requires authentication and the program stopped working properly
by Marijan Nikic
One-file shell-integrated easy solution for automatic recognition of movies and TV shows

Latest Articles

by Minh Danh Nguyen (ToughDev)
Dual-system Bluetooth keyboard setup: Seamless pairing with Windows 11 and Ubuntu 22
by Bruno van Dooren
This article describes how to use Windows transactions to recursively delete a registry tree under a registry subkey and then the subkey itself.
by Greg Utas
Registering and efficiently accessing polymorphic objects
by Marijan Nikic
One-file shell-integrated easy solution for automatic recognition of movies and TV shows

All Articles

Sort by Score

Registry 

6 Jun 2014 by Amir Mohammad Nasrollahi
How to list the installed applications of your system and their setup details in C# language
23 Oct 2015 by Michael Chourdakis
A simple template for manipulating the registry
4 Jul 2016 by Avelino Ferreira
"Don't care about Google Maps/Routing/StreetView programming. This Control gives your WinForms applications the power of Google Maps API v3". - my previous article. Unfortunately, since Dec.2015, Google Maps JavaScript API applications requires authentication and the program stopped working properly
13 Nov 2019 by Marijan Nikic
One-file shell-integrated easy solution for automatic recognition of movies and TV shows
16 Aug 2022 by Bruno van Dooren
This article describes how to use Windows transactions to recursively delete a registry tree under a registry subkey and then the subkey itself.
15 May 2013 by Sergey Alexandrovich Kryukov
You cannot do it in the application setting up the registry. You can only do it in the target application itself, the one you want to be executed in a single instance.As you did not tag the language and the platform (always do it), I'll just explain the idea.By definition, OS can start...
9 Oct 2015 by OriginalGriff
The chances are that you need admin permission to change the SYSTEM area of the registry and your modification is being rejected as a result.This is a good example of why swallowing exceptions is a bad idea: you have no idea there is a problem, or any details about it, just that the code...
6 Nov 2011 by LanFanNinja
Ok so first I think its probably a permissions problem.Is the text file with the clock info a file you create your self? If so do not store it in C:\Windows\System32 instead store it in your users application data directory. The path to that directory can be found using the following:'for...
3 Feb 2017 by Satish Jagtap
This article is written in VC++ as utility to manage startup applications of Windows.
17 May 2018 by User 7429338
The path you are looking for is under HKEY_LOCAL_MACHINE, not under HKEY_CURRENT_USER.
30 Jun 2021 by CPallini
Quote: system("reg add HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\ /v TEST /t REG_SZ /d CPU Name"); The backslash is the escape character in C/C++ strings, and it must be escaped as well. Replace every occurrence of \, in...
9 Apr 2012 by Sergey Alexandrovich Kryukov
The method OpenSubKey can return null, so this is the first candidate for this exception. Please see:http://msdn.microsoft.com/en-us/library/xthy8s8d.aspx[^].Also, you did not show the code for unins, so I cannot tell if the exception is there. Or anywhere else.Not to worry. This kind...
6 Jun 2012 by SoMad
If I was you I would take a different approach to this. I use USB COM port devices all the time and when I plug them in, some of them remember the port number they were assigned the last time they were plugged in - this is often very useful to me.Instead of using EnumPorts try looking at PJ...
24 Jan 2013 by Adam R Harris
it's a security thing, take a look at this article and you should have your answer: http://msdn.microsoft.com/en-us/library/system.security.permissions.registrypermission(v=vs.90).aspx[^]
3 May 2013 by AlphaDeltaTheta
I see...Wow6432 is the 32 bit registry hive that is visible 32 bit apps. Probably you are running your app as a 32 bit process. Such process can only access 32 bit values in the registry i.e, values under Wow6432 node. Whereas, 64 bit apps can do both. Since you are using a 64 bit OS, your key...
2 Jun 2014 by Fredrik Bornander
Make sure you open the correct hive depending on machine configuration (64 or 32 bit).This code might work better for you;Sub Main() Using hklm As RegistryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, IIf(Environment.Is64BitOperatingSystem, RegistryView.Registry64,...
12 Jul 2014 by Richard MacCutchan
Easy, use the documentation[^].
20 Apr 2016 by Dave Kreskowiak
Error code 2 is FILE NOT FOUND.You can find what those error codes are here[^].The path you built doesn't exist on the target machine.
30 Apr 2016 by Richard MacCutchan
See also Wallpaper Changer[^].
15 Jun 2017 by Dave Kreskowiak
Two possibilities: 1) You really didn't register MDMLib.dll. REGASM only works on .NET libraries. If this .DLL is not a .NET library, you use REGSVR32 on it instead. 2) One or more .DLL's MDMLib.dll depends on are not present and/or registered where MDMLib expects them.
31 Jan 2019 by Ralf Meier
Sometimes Google helps : [^] Perhaps you try it like this ...
5 Nov 2020 by Richard Deeming
You're potentially throwing another NullReferenceException from within your first catch block. But you don't need either of those catch blocks: public bool ValueExists(string Key, string Value) { using (RegistryKey rk =...
21 Jan 2022 by Dave Kreskowiak
A major problem with the Registry is portability. The Registry is specific to Windows only. That means you cannot use it if you port your code over to other platforms, like phones. If all you're doing is storing a small list of settings, speed...
8 Aug 2011 by Dalek Dave
Fixing a Profile Services Problem when administrator password will not allow access.
18 Sep 2011 by Sergey Alexandrovich Kryukov
You need to master such a basic method of abstraction as "function with parameters". The registry keys and a values to set should be passed as parameters to the code.The fact you show this code with access to OS API and immediate constants hard-coded in this fragment (which is really bad in...
20 Nov 2011 by thatraja
Found this Microsoft KBError message: "The User Profile Service failed the logon. User profile cannot be loaded”, when logging on to Windows 7 or Windows Vista[^]From Link[^]:Method 1: Fix the User Account ProfileMethod 2: Log on to Windows and copy your data to a new accountMethod...
16 Dec 2011 by OriginalGriff
You can't, not really. You can't protect a registry key against all editing, or reading - if nothing else, your software has to be able to read the key in order to check it, so any software can do the same - as as you have seen, it isn't difficult tyo write software to read a registry key! The...
22 Dec 2011 by CPallini
Because, as already noted by Jochen Arndt, RegQueryValueEx does NOT work that way: you misunderstood the function documentation. Change, for instancewindyl3ig wrote:dwRet = RegQueryValueEx( HKEY_LOCAL_MACHINE, ...
3 Jan 2012 by OriginalGriff
The problem is that it could be either part of that:reg.GetValue("Isregistered", true)reg could be null - you don't show it being defined or initialisedreg.GetValue("Isregistered", true).ToString()If reg is ok, then GetValue could be returning null.Or, it could be in your GetValue method...
10 Jan 2012 by lilyNaz
Hi,I need to customize right click so that I can scan a directory with my anti-virus. I know how to do that using registry keys, ... but the problem is that I don't want to start a new instance of my program every time I want to scan a directory. My anti-virus needs to load some signature...
3 May 2012 by Chandrasekharan P
Does this code help you? #define BUFFER 8192int main(){ char value[255]; DWORD BufferSize = BUFFER; RegGetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "SystemRoot", RRF_RT_ANY, NULL, (PVOID)&value, &BufferSize); std::cout
24 May 2012 by Maciej Los
This is quite often occurence...Try to pass the full path to MSADO10.dll.If it won't help, follow these links:http://support.microsoft.com/kb/2517589[^]http://msdn.microsoft.com/en-us/library/windows/desktop/ms692877%28v=vs.85%29.aspx[^]
30 May 2012 by Maciej Los
Start here[^], then take a look at the following example, which demonstrates how to retrieve the subkeys of this key, and prints their names to the screen: [Visual Basic] Imports SystemImports Microsoft.Win32Class Reg Public Shared Sub Main() ' Create a...
30 May 2012 by Richard MacCutchan
You want RegEnumValue()[^].
6 Jun 2012 by Stephen Hewison
In later versions of Windows some of the registry is protected. You need to assign permissions to your user to be able to delete it.The follow article describes how to do this:http://www.raymond.cc/blog/full-control-permission-to-delete-or-edit-restricted-windows-registry/[^]
5 Sep 2012 by ravijain03
I have write one shell extension handler which register my dll into registry to add Windows 7 64 bit Context Menu entry for my application. It done for file and directory but now i want to add entry on Recycle Bin context menu. I have write the code in VC++ (framework 4.0)
17 Oct 2012 by Mukesh_Chauhan
app.manifest should be like this:
1 Feb 2013 by Zoltán Zörgő
You have to change file association. You can use this tool for example: System File Association[^]But be aware that user can override this association anytime.
13 Mar 2013 by Sergey Alexandrovich Kryukov
Please see my comment to the question. I think this is not the question to be answered in the forum. It's rather a research and development work to be done. The only reasonable answer would be just doing a considerable part of this work, with, please understand it, would be a bit too much for a...
24 Mar 2013 by Sergey Alexandrovich Kryukov
Well, look at the XML standard. The character with the code point 0 is not considered as a valid character in XML.As you did not show how you obtained the XML file and did not show any XML sample, that's all. Everything else in your question is irrelevant: the parsing code may be correct,...
24 Mar 2013 by Maxim Kartavenkov
Well, this bcs of your system does not know abt your files.You should just specify handlers for that in registry:HKCR\{your extension} - in here you can put the information abt your extension and how it should be handled (including opening displaying in shell and so on)Actually I think...
26 Mar 2013 by Beat Laemmle
With Maxim's help I figured out the necessary registry entries to see the properties of an OLE compound document.These registry entries solved that issue:; For ZipPackages use; {45670FA8-ED97-4F44-BC93-305082590BFB} Microsoft XPS Shell Metadata Handler; For OLE Documents use;...
12 May 2013 by Richard MacCutchan
Try it with this version of the delete[^], and catch any exceptions that are raised.
6 Jun 2013 by Sergey Alexandrovich Kryukov
I don't think so. Starting from Vista, and reasonably set up, I think, only in Windows 7, UAC is not to be bypassed. I mean, you can bypass UAC only if the user gives an explicit permission. In particular, the whole UAC check can be disabled for a whole system, and then the system really becomes...
18 Jun 2013 by Dave Kreskowiak
It's probably the length of a string that would be returned. In Win32, it's common to call certain functions and pass in a buffer or length of 0 for the function to fill. Usually, this causes the called function to return a value that tells the caller how big a buffer needs to be to hold the...
15 Aug 2013 by KarstenK
you have one big problem: Understand that you work in ANSI-Mode but using Unicode function. It leads to strange string which cant be interpreted by the API. Look to what the used macro get resolved.Use the functions without the "W" at the end.
11 Nov 2013 by Kornfeld Eliyahu Peter
It is a security issue.In real word environment (not IDE debugging) your code runs inside the browser on the client machine AND TRY TO READS THE REGISTRY OF THE CLIENT!!!. However, browser security prevents from you to do so.In any case I believe you missing here some point. Web...
5 Dec 2013 by OriginalGriff
Ron is right - app.config or a file is the best solution. Don't use the registry for anything unless you really have to - it was badly abused in the "old days" and access is now restricted, and likely to get more restricted as time goes on.Personally, I'd use my own file in a "open" folder -...
3 Jan 2014 by AAv.Soft
I DID IT!!! :)Dim TS__x64 As Microsoft.Win32.RegistryKey = Microsoft.Win32.RegistryKey.OpenBaseKey _ (Microsoft.Win32.RegistryHive.LocalMachine, Microsoft.Win32.RegistryView.Registry64)Dim CALE_TS__x64 As String =...
19 Jan 2014 by pkfox
Just to eliminate one possible cause of an error, try passing false into the OpenSubKey method - this makes the key readonly which is all you need in this case.
25 Feb 2014 by osamaworx
I am tring to make some file extention associated to my application like make any file with .ztr work directly with my app when user double click that file I am using VS2012 , C# , Windows 7 I did simulate this Example here https://www.youtube.com/watch?v=s_YUcBxc5xM[^]sure with some...
1 Mar 2014 by CHill60
http://www.thewindowsclub.com/...
9 Dec 2014 by MasterCodeon
Hello all.I would like to know how to check if a Registry value exist in C#.i know how to do this in VB: If Microsoft.Win32.Registry.GetValue("HKEY_CURRENT_USER\Software\Number Averaging Program", "SpeechEnable", Nothing) Is Nothing Then MsgBox("There Are No Registry...
28 Dec 2014 by Sergey Alexandrovich Kryukov
This is one of the reasons why it's really bad to use some 3rd-party code without source code. I would advise to avoid it by all means. By the way, the problem has nothing to do with registry (thanks goodness, more and more software products these days don't contaminate system registry anymore,...
20 Feb 2015 by E.F. Nijboer
Try calling something like this:RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 path-to-inf\infname.infCheck this link for more info:https://msdn.microsoft.com/en-us/library/windows/hardware/ff557251%28v=vs.85%29.aspx[^]Good luck!
18 Aug 2015 by F-ES Sitecore
The "Start" event of your service needs to finish its work and complete within a set time, normally 90 seconds I think. Same with your Stop event.You haven't posted any code, but I'm going to assume you are looping\sleeping in the Start event so it never finishes which is why you get this...
19 Jan 2016 by Richard MacCutchan
You need to use the Remote registry service as described in The Windows Remote Registry Service | PC Tutorials[^].
17 Jun 2016 by OriginalGriff
First off, why would you want to do that? Retrieve the Registry entry properly and use the value it returns: Registry.GetValue Method (String, String, Object) (Microsoft.Win32)[^]Secondly, did you really expect that to work? The first thing Regedit will do is kick up UAE to get user permission...
27 Feb 2017 by Jochen Arndt
There may be two reasons for such behaviour.The first is that the page is not requested again but got from the cache. This can be only avoided by clearing the cache (see How to clear the cache when your application hosts a WebBrowser control in Visual C# .NET[^]).The second reason might...
12 Sep 2017 by Richard Deeming
The most likely cause is that you're running a 32-bit application on a 64-bit OS: c# - OpenSubKey() returns null for a registry key that I can see in regedit.exe - Stack Overflow[^] By default, you'll be looking in HKLM\Software\Wow6432Node, thanks to the registry redirector: Registry...
24 May 2018 by OriginalGriff
Just like there is no "Paste Event", there is no "Paste Registry key" or even "Paste Context menu item" - Context menus are free text, they aren't "windows standard items" where all apps use the same items (like they do for Open and Save dialogs). You can create your own context menu which uses...
25 Jul 2018 by Dave Kreskowiak
There's nothing you can put into the registry that's going to do the whole "If there's something on the clipboard" thing. You're going to have to provide actual code for that and modify the context menu on-the-fly. The only way to do that is to write a shell extension. This is FAR from a...
5 Feb 2019 by Maciej Los
MSDN documentation is here: Reading from and Writing to the Registry (Visual Basic) | Microsoft Docs[^] It contains information about security: Quote: Robust Programming The registry holds top-level, or root, keys that are used to store data. For instance, the HKEY_LOCAL_MACHINE root key is...
6 Feb 2019 by Richard Deeming
I already gave you the answer to that question two weeks ago! Need help with VB.NET code with dotnet 2.0 framework only[^]: How to read the 64 bit registry from a 32 bit application or vice versa | Rhyous[^] EDIT: VB.NET translation of the code from example 2: Imports System Imports...
4 Mar 2021 by deXo-fan
Hello, I know similar problems have been posted here before. I know this because I've searched this site for solutions, but the ones I've found haven't worked out for me. I have a problem with the web browser control. Right now, it renders pages like an old version of Internet Explorer. I need...
23 Jan 2020 by Richard Deeming
Those appear to be the correct registry keys and values: Web Browser Control & Specifying the IE Version - Rick Strahl's Web Log[^] I suspect the MainForm_Load event is too late to set them; the control will already have been initialized by this point. You could try updating the registry from...
21 Jun 2020 by Member 3017361
I hit the same problem: took a day of debugging what to hook. If you want to hook the registry access -- you need to snag the versions in kernelbase.dll not advapi32.dll or kernel32.dll. Otherwise some things will hook, but others, like...
30 Jun 2021 by Richard MacCutchan
Adding keys to the registry can make your system unusable, especially when not using the proper API calls. You should use Registry Functions - Win32 apps | Microsoft Docs[^], and only ever add to a keyname that you create inside HKEY_CURRENT_USER.
11 Feb 2022 by OriginalGriff
You can't - it doesn't know or care why the WiFi no longer works, just that the device is no longer connected. Think about it: the phone line could have failed, the power gone, the router burst into flames, the user unplugged the router, he...
24 Sep 2022 by Gerry Schmitz
Quote: The version of .NET Framework (4.5 and later) installed on a machine is listed in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full. If the Full subkey is missing, then .NET Framework 4.5 or above isn't...
24 Sep 2022 by RickZeeland
The registry location seems to change per update as a user commented here: Correct approach to Check for .NET 6 installation - Microsoft Q&A[^] Quote: ...
3 Mar 2023 by Richard MacCutchan
PowerShell is fun :) Export registry information using PowerShell[^] Batch Script - Reading from the Registry[^]
23 Jan 2024 by Minh Danh Nguyen (ToughDev)
Dual-system Bluetooth keyboard setup: Seamless pairing with Windows 11 and Ubuntu 22
25 Mar 2023 by l o o l
Understand that this is true said by Dave-Kreskowiak You cannot export a single value. You would have to write your own tool to do that A bat would do that, but use a filter and a temp file: @echo off set "_hkey=HKLM\SOFTWARE\Dinesh" >nul reg...
30 Sep 2011 by Wannes Geysen
I have written a windows forms application. Before I run the form, I write the startup time to a log textfile. This is done in the Program.Main() method.When I run the program, everything works perfect. But now I want to start the application on windows logon. So I have written the...
30 Sep 2011 by Abhinav S
Looks like you don't have access to the file using this login.Make sure this login has access to the directory path.
30 Sep 2011 by André Kraak
The registry key you mentioned (HKLM/Software/Microsoft/Windows/CurrentVersion/Run) starts applications when windows is started, so at that time no user has logged on yet and your application does not have the right credentials to perform the write action you want.If you want the program to...
30 Sep 2011 by Ray Radin
Does your app open or create a file using relative path?If so, the cause of the problem is a difference of current directory.If you run the app yourself, the current directory is the directory where the app is located.If you use either HKLM\...\Run or HKCU\...\Run the current directory...
17 Oct 2011 by E.F. Nijboer
Have a look at the links with some examples of how to traverse the registry:http://msdn.microsoft.com/en-us/library/df4afx57.aspx[^]http://www.codeguru.com/cpp/w-p/system/registry/article.php/c5671[^]Good luck!
17 Oct 2011 by Richard MacCutchan
Use RegEnumKeyEx[^], and any of the other enumeration functions to find the elements that you are interested in.
6 Nov 2011 by thekman28
Hi,I've been playing around with the registry trying to get my countdown app to start when Windows does. It starts fine but when it runs, Windows looks for the text file with the clock info in c:\windows\system32 and then crashes as it can't find it. Running the app from its directory works...
16 Dec 2011 by hairy_hats
Hi all,I've got an MFC project that was originally developed under VC++6, and it used to set up file associations perfectly under XP.Now with the same program converted to VS2005 and running under Windows 7, it is exhibiting strange behaviour: when you double-click on a file, nothing...
16 Dec 2011 by Albert Holguin
You may not be passing the correct arguments to the program... do a search in the registry to see if the default command line arguments are correct. Also, you can probably do a mini-dump of the initialization data in your executable to see why it's failing (send debug information to...
16 Dec 2011 by krunal25
Hello everyone,I have made one software which requires license key for installation, once you have got a license key the key gets encrypted and get stored in Registry.Now the problem is people have become very smart and they just do one thing i.e. they just export registry key and run it...
19 Dec 2011 by hairy_hats
No idea which specific thing fixed it - I've moved code around in InitInstance(), which I think was the solution.
20 Dec 2011 by nishantcomp2512
while creating and installer of same project the version of your application automatically detected by installer and installer itself check for older version.Regards,
21 Dec 2011 by windyl3ig
Hello everyone,I try to read a value from registry, I try this codeNote : based on Windows7: using MSVC++2010 as tool#include #include #include #define TOTALBYTES 8192void main(){ DWORD BufferSize = TOTALBYTES; DWORD...
3 Jan 2012 by sharadpanwal
I have c# application which include code to retrieve registry values and check it's values.registry values stored in following manner:MainKey: Name:user123 Isregistered:nohowever if Isregistered returns no,it will display appropriate message.i am getting error like...
3 Jan 2012 by RaviRanjanKr
you can pass Isregistered value in Read method for access Registry value as Read("Isregistered ");have a look at method declarationpublic string Read(string KeyName){ // Opening the registry key RegistryKey rk = baseRegistryKey ; // Open a subKey as read-only ...
3 Jan 2012 by sharadpanwal
i got solution.Thanks for help.RegistryKey reg = Registry.CurrentUser.OpenSubKey(@"MainKey", true); string currentKey; if (reg != null) { RegistryKey rKey = reg.OpenSubKey("Isregistered", true); ...
10 Jan 2012 by «_Superman_»
There are many ways to have only one instance of a program running and communicate with it.You can run the program as a service and communicate with the service using named pipes.Or you can send a custom message to an already running program using RegisterWindowMessage.You can even use...
31 Jan 2012 by Christine_Irene
Hi,I have a COM dll with a class in it.I have an app with a UAC level of asInvoker. This app creates a COM object as administrator.Everything works fine running as administrator, and even logged in as standard user, right->click runas administrator.However, when I log in as...
2 Feb 2012 by YvesDaoust
I am writing keys to the registry using a .reg file. The keys are deemed to go to HKEY_LOCAL_MACHINE\SOFTWAREon my Windows 7 64 bits machine, this works fine. I can read the keys using RegOpenKeyEx(..., KEY_READ | KEY_WOW64_64KEY, ...).Anyway, on another Windows 7 64 bits, they go to the...
2 Feb 2012 by Richard MacCutchan
I think you may need to remove the KEY_WOW64_64KEY selector; see here[^] for Microsoft's explanation of these features.
2 Feb 2012 by Chuck O'Toole
1) the .REG file has nothing to do with where the symbol goes with respect to the WOW / 64 bit redirection.2) the application that *processes* the .REG file will end up being the determining factor.3) if you ran the REG file through regedit32, it will go into the WOW redirected area. If...
3 Feb 2012 by Shanmugam Rathakrishnan
i need to create registry key while installing my setup file. what i have to do....Actually i created the installer class with the below code.using System;using System.Collections;using System.Collections.Generic;using System.ComponentModel;using...
4 Feb 2012 by bbirajdar
You need to change the installer .NET Framework Launch Condition property which is by default 3.5 . You have to change it back to 2.0