registry

How to access the 64-bit registry from a 32-bit Powershell instance?

我与影子孤独终老i 提交于 2019-12-18 05:37:46
问题 If you launch a 32-bit instance of Powershell (%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe), then the registry provider only sees the limited 32-bit parts of the registry. **32-bit console** PS> (dir HKLM:\SOFTWARE | measure).count - (dir HKLM:\SOFTWARE\wow6432node | measure).count 0 **64-bit console** PS> (dir HKLM:\SOFTWARE | measure).count - (dir HKLM:\SOFTWARE\wow6432node | measure).count -5 Is there any way to force the provider into 64-bit mode? I could drop down to

how to filter name/value pairs under a registry key by name and value in PowerShell?

Deadly 提交于 2019-12-18 05:12:50
问题 I'm trying to get a feel for the idioms to use in PowerShell. Given this script: $path = 'hkcu:\Software\Microsoft\Windows\CurrentVersion\Extensions' $key = Get-Item $path $key I get the output at the bottom of this question. I'd like to get output of the properties (the name/value pairs under the $key ) where I can filter on both name and value. For instance, filter to list all the Extensions that have: name like xls* or value like *\MSACCESS.EXE Or an exclude filter: exclude all names like

How do I associate a filetype with an icon?

拟墨画扇 提交于 2019-12-18 05:07:15
问题 I have written preview handlers for a couple custom file types. These file types don't have an application by default that can open them. I want to associate an icon with the file types as a signifier that they are custom. I have tried setting a registry entry for DefaultIcon in HKCR\.<filetype> , but it doesnt appear to work, even after reboots. I do these registry modifications from C#, and the modifications are successful. The icon file is simply an ico file residing in %APPDATA% for the

Why is registry written in different location than expected?

陌路散爱 提交于 2019-12-18 04:44:12
问题 I tried to write a registry subkey and its corresponding value to registry like this: const string subKey = @"SOFTWARE\Apple\Banana\"; const string regKey = "pip"; var rk = Registry.LocalMachine.OpenSubKey(subKey); if (rk == null) rk = Registry.LocalMachine.CreateSubKey(subKey); var rv = rk.GetValue(regKey); if (rv == null) rk.SetValue(regKey, "XXX"); return rv.ToString(); Now the problem is that I when I look in the location manually (via regedit) I cannot see the folder SOFTWARE\Apple

Windows Context menu shell icon

我们两清 提交于 2019-12-18 04:01:36
问题 I have created a new Windows shell context menu item using registry and keys HKLM\Software\Classes\Folder\shell\appname HKLM\Software\Classes\Folder\shell\appname\command now I want to add an icon to this command. How I do that? 回答1: Windows 7 added support for icons (and submenus) for static (registry) verbs, add a REG_SZ value named "Icon" under HKCR\%ProgID%\shell\%verb% On <= Vista you need a shell extension that implements IContextMenu, see this blog entry for information about which

How can I read 64-bit registry key from a 32-bit process?

不想你离开。 提交于 2019-12-18 03:41:53
问题 I've been using the value of key MachineGuid from HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography to uniquely identify hosts, but from 32-bit processes running on 64-bit computers, the value appears to be missing. I guess it's searching under Wow6432Node, where it is indeed missing. According to this you should be able to get to the right key by adding a flag, but below code still doesn't appear to do the job. What am I missing? const KEY_WOW64_64KEY=$0100; var r:HKEY; s:string; i,l

How can I read 64-bit registry key from a 32-bit process?

久未见 提交于 2019-12-18 03:41:36
问题 I've been using the value of key MachineGuid from HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography to uniquely identify hosts, but from 32-bit processes running on 64-bit computers, the value appears to be missing. I guess it's searching under Wow6432Node, where it is indeed missing. According to this you should be able to get to the right key by adding a flag, but below code still doesn't appear to do the job. What am I missing? const KEY_WOW64_64KEY=$0100; var r:HKEY; s:string; i,l

How to search for specific value in Registry keys

我是研究僧i 提交于 2019-12-18 03:40:12
问题 How can I search for specific value in the registry keys? For example I want to search for XXX in HKEY_CLASSES_ROOT\Installer\Products any code sample in C# will be appreciated, thanks 回答1: In case you don't want to take a dependency on LogParser (as powerful as it is): I would take a look at the Microsoft.Win32.RegistryKey class (MSDN). Use OpenSubKey to open up HKEY_CLASSES_ROOT\Installer\Products, and then call GetSubKeyNames to, well, get the names of the subkeys. Open up each of those in

Reading a registry key in C#

。_饼干妹妹 提交于 2019-12-17 22:34:55
问题 I have developed an application and installed it on a client computer. In my application I need to get its installation path. My application has a registry entry at: HKEY_LOCAL_MACHINE\SOFTWARE\MyApplication\[AppPath] How can I read AppPath using C#? 回答1: see this http://www.codeproject.com/Articles/3389/Read-write-and-delete-from-registry-with-C Updated: You can use RegistryKey class under Microsoft.Win32 namespace. Some important functions of RegistryKey are as follows: GetValue //to get

How to create License for my Java Software? [closed]

巧了我就是萌 提交于 2019-12-17 21:54:27
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . I am having a very big problem. That is "How to Create License for my software". OK, Think this is my License key - 12345YW when the user enter this license key , the software should allow him to use the software. All right, once the user enter the license key, my software must remember he has