registry

Loop through Registry Python

大城市里の小女人 提交于 2020-01-06 12:55:04
问题 I am trying to write a small application that checks each value in the Windows Registry for valid file paths, provided it is a REG_SZ. I need to be able to loop through all of the keys and subkeys reading each value as I go. I looked in to _winreg, but couldn't find any clear examples for this task. Any help would be great! 回答1: _winreg.OpenKey to open a given registry key. _winreg.EnumKey to enumerate the sub-keys of a given registry key. And you have the _winreg.HKEY_CLASSES_ROOT and

RegSaveKeyEx Requires Elevation?

元气小坏坏 提交于 2020-01-06 12:22:26
问题 I have code that uses Win API function RegSaveKeyEx to save registry entries to a file. However, RegSaveKeyEx returns ERROR_PRIVILEGE_NOT_HELD when run on Win Vista or Win 7. The code enables security privilege SE_BACKUP_NAME using code Microsoft provides in example function SetPrivilege. Everything works fine on Win XP (admin user) or if I disable UAC on Win Vista or Win 7. Is it not possible to use RegSaveKeyEx on Vista without elevating the process? 回答1: Standard users do not have SE

how do i start explorer using process class in c#

为君一笑 提交于 2020-01-06 04:54:06
问题 i have replaced windows shell with my application it worked perfectly, after closing my application i have to launch windows explorer with the following piece of code Code to start explorer Process.Start(@"c:\windows\explorer.exe"); Registry key i have used to replace shell HKEY_Local_Machine\Software\Microsoft\WindowsNT\CurrentVersion\WinLogon\Shell it doesnt show taskbar and start menu, it just shows mydocuments folder. I need start menu and taskbar while after explorer started 回答1: My

How to iterate registry from the root?

旧时模样 提交于 2020-01-05 21:19:11
问题 I would like to search all the registry (HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS and all of the subkeys) for a specific value and if there is a match I would like to delete this entry . Is there a way to do this? I found a sample like below but it is not iterating all the registry. Best Regards and thanks in advance. Const HKCU = &H80000001 Const HKLM = &H80000002 Const HKU = &H80000003 Const REG_SZ = 1 Const REG_EXPAND_SZ = 2 Const REG_BINARY = 3 Const REG_DWORD

Inno Setup - Registry uninsdeletekey - exclude upgrade

左心房为你撑大大i 提交于 2020-01-05 13:54:21
问题 I have an Inno-Setup installation with the following entry in the [Registry] section Root: HKCU; Subkey: SOFTWARE\MyCompany\MyApp; ValueName: MyKey; Flags: uninsdeletekey noerror Which as stated by the flags is to be deleted upon uninstall. But I need it to be preserved in case the uninstall is due to version upgrade. How can it be done? Check maybe? Thanks. 回答1: You will need to pass the information that you want to preserve the key to the uninstaller since it doesn't know who executes it

How to return a default value from windows/registry with golang

心不动则不痛 提交于 2020-01-05 04:04:06
问题 I just want to return a (Default) string value in Windows registry with Golang k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE) if err != nil { log.Fatal(err) } defer k.Close() s, _, err := k.GetStringValue("(Default)") // It won't work // s, _, err := k.GetStringValue("SystemRoot") // This is worked if err != nil { log.Fatal(err) } fmt.Printf("Windows system root is %q\n", s) I run it in CMD admin mode but there was

Run a batch file at folder's context menu

北城以北 提交于 2020-01-05 02:18:10
问题 I'd like to run this batch file (setenv.cmd) when I right click on any folder: @echo off SET CPLUS_INCLUDE_PATH=C:\mingw32\include;C:\mingw32\lib\gcc\mingw32\4.9.2\include; SET PATH=%PATH%;C:\Archivos de programa\7-Zip;C:\Archivos de programa\WinRAR;C:\usr\bin;C:\msys\1.0\bin;C:\gtk2\bin SET PKG_CONFIG_PATH=C:\gtk2\lib\pkgconfig;C:\usr\lib\pkgconfig @echo on I setuped my registry from this page, with the "prompt here". My question is how to open the console window from the selected directory

Run a batch file at folder's context menu

故事扮演 提交于 2020-01-05 02:18:05
问题 I'd like to run this batch file (setenv.cmd) when I right click on any folder: @echo off SET CPLUS_INCLUDE_PATH=C:\mingw32\include;C:\mingw32\lib\gcc\mingw32\4.9.2\include; SET PATH=%PATH%;C:\Archivos de programa\7-Zip;C:\Archivos de programa\WinRAR;C:\usr\bin;C:\msys\1.0\bin;C:\gtk2\bin SET PKG_CONFIG_PATH=C:\gtk2\lib\pkgconfig;C:\usr\lib\pkgconfig @echo on I setuped my registry from this page, with the "prompt here". My question is how to open the console window from the selected directory

Check for reboot pending status in VB

帅比萌擦擦* 提交于 2020-01-04 09:27:15
问题 I'm currently trying to determine if a computer is in a "pending reboot" status after applying Microsoft patches in a VB program I'm writing. I have the following: Private Sub DoesKeyExist() Dim regKey As Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update\\RebootRequired", True) If regKey Is Nothing Then MsgBox("No reboot pending.") Else MsgBox("Reboot is pending") End If End Sub This

How to register a Property Handler on folders?

一世执手 提交于 2020-01-04 08:19:06
问题 I built a virtual filesystem (not a namespace extension) for Windows which acts as a frontend of our document management server consisting of files and folders. In order to be able to display some metadata of the DMS objects in Windows Explorer as additional selectable columns, I successfully provided properties to the Windows Property System by implementing a COM Property Handler. Wheras normal property handlers focus on specific file types for which they feel responsible, my Property