registrykey

COM co-class per-user registration

那年仲夏 提交于 2019-12-11 06:27:52
问题 Need to implement per-user registration of a COM co-class by adding registry entries to the HKCU registry hive (XP SP3, Windows 7, Windows 8). What is the minimal set of required registry entries to create an object instance by calling the VBScript CreateObject function? UPD: VBScript implementation Sub RegisterComObject(Path, ProgId, ClsId) Dim Shell Set Shell = WScript.CreateObject("WScript.Shell") Shell.RegWrite "HKCU\Software\Classes\" & ProgId & "\", "" Shell.RegWrite "HKCU\Software

Why does this Attempt to Update a Registry Value Fail?

血红的双手。 提交于 2019-12-11 06:24:49
问题 I have this code: RegistryKey myKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Android Studio", true); myKey.SetValue("StartMenuGroup", "Droidio", RegistryValueKind.String); // was "Android Studio" - change to "Droidio" ...which I adapted from here. Running it, though results in the following NRE dump: *System.NullReferenceException was unhandled _HResult=-2147467261 _message=Object reference not set to an instance of an object. HResult=-2147467261 IsTransient=false Message=Object

Edit Registry Keys

∥☆過路亽.° 提交于 2019-12-11 02:38:11
问题 i need to edit those registry keys HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SafeBoot\Minimal HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SafeBoot\Network to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SafeBoot\Minimal- HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SafeBoot\Network- I tried with RegistryKey key = Registry.LocalMachine.OpenSubKey(@"System\CurrentControlSet\Control\SafeBoot\Minimal", true); but then there is not rename,copy method. 回答1: From Copy

Create a REG_NONE empty value in the Windows Registry via C#

旧城冷巷雨未停 提交于 2019-12-10 18:39:25
问题 How can I create an empty value in the Windows Registry that has the type REG_NONE ? For instance, for this key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\ .htm\OpenWithProgids Here are the values that I see on my Windows 7 machine: ---------------------------------------------------- Name Type Data ---------------------------------------------------- (Default) REG_SZ (value not set) FirefoxHTML REG_NONE (zero-length binary value) htmlfile REG_NONE (zero

.NET 3.5 Dispose Registry Key

非 Y 不嫁゛ 提交于 2019-12-10 09:26:31
问题 I have the following code: RegistryKey installKey = Registry.LocalMachine.OpenSubKey(installKey); I am running a static analysis tool on my code and it is giving me a defect saying that I am returning from the medthod without disposing installKey . I know you can call Dispose() on RegistryKey in .NET 4.0 or later but my code runs on .NET 3.5. Does anybody know the best way to Dispose this RegistryKey and keep my static analysis tool happy? 回答1: You should wrap your code within a using block,

Remove a 'Deny' rule (permission) from the 'UserChoice' key in the Registry via C#

对着背影说爱祢 提交于 2019-12-04 11:36:47
I am working on File Associations. I have identified that there is a key called UserChoice in: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\[ext]. I have been able to read from and write to the UserChoice key provided that I create it and that it has not already been created by Windows. However, if the UserChoice key has already been created by Windows, then I need to run as Administrator to get access to the key. My ultimate goal is to delete the UserChoice key. I have noted that Windows places a Deny rule on the UserChoice key which is preventing me from

Mysterious, Native “A” Registry Key with Path: Registry\\A

吃可爱长大的小学妹 提交于 2019-12-04 04:02:18
I recently wrote a native NT registry editor for Windows, and ran it on Windows 7. To my surprise, in addition to the two standard root keys, MACHINE and USER, that are present on Windows XP, there was also a mysterious key named "A", that cannot be opened in any way, whether by permission changes or backup privileges or otherwise: Does anyone know what this key is for? I don't believe it's for any software, because it was there before I installed anything on the machine, and I believe I saw it on another fresh installation as well. It's rather very suspicious, and I'm curious as to why it's

Adding a registry key in windows with quotes needed in the data using a batch script

半世苍凉 提交于 2019-12-03 03:00:33
Little Willis here. I am trying to using a batch script to edit an existing registry key that is used when double clicking a .jar file. The issue is that the data that I'm trying to enter contains quotes but I also need quotes for it to be considered a string. Example: reg add "HKEY_LOCAL_MACHINE\Software\Classes\jarfile\shell\open\command" /v "" /t REG_EXPAND_SZ /d "C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %* /f When I run that in a batch script the cmd window prints out "Error: Too many command line parameters" So to make this simple. I want to add a registry key with "C:\Program

How do I get the value of a registry key and ONLY the value using powershell

断了今生、忘了曾经 提交于 2019-12-02 21:34:02
Can anyone help me pull the value of a registry key and place it into a variable in PowerShell? So far I have used Get-ItemProperty and reg query and although both will pull the value, both also add extra text. I need just the string text from the registry key and ONLY the string text from the key. I'm sure I could create a function to strip off the extra text but if something changes (i.e. reg key name) it might affect this. Andy Arismendi $key = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion' (Get-ItemProperty -Path $key -Name ProgramFilesDir).ProgramFilesDir I've never liked how this was

How can I determine which Registry setting gets updated when the user selects “Files - Sync Settings” in ActiveSync?

为君一笑 提交于 2019-12-02 14:40:15
问题 I'm no longer sure that "GuestOnly" is really the registry key I need to change to prevent file syncing between a handheld device and the PC to which it is connected. If I open ActiveStync's "Windows Mobile Device Center", select "Mobile Device Settings" then "Change content sync settings" and check or uncheck "Files - Sync Settings", it does not alter the value of the "GuestOnly" registry key in "SOFTWARE\Microsoft\Windows CE Services" The "GuestOnly" value remains 0x00000000 (0) no matter