regedit

Enable/Disable TaskManager

不问归期 提交于 2019-12-19 10:25:45
问题 public static void ToggleTaskManager(string keyValue) { RegistryKey objRegistryKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"); objRegistryKey.SetValue("DisableTaskMgr", keyValue); objRegistryKey.Close(); } private void btnDisableTaskManager_Click(object sender, EventArgs e) { ConsoleDisplay.ToggleTaskManager("1"); } private void btnEnableTaskManager_Click(object sender, EventArgs e) { ConsoleDisplay.ToggleTaskManager("0"); } For

How to do RegAsm so that it cover 32-bit and 64-bit?

有些话、适合烂在心里 提交于 2019-12-18 07:29:13
问题 I have a DLL file prepared by C# and my system is Windows 7 64-bit. When i apply the RegAsm its not adding the registry to 64-bit path but only adding it to 32-bit path. "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe" /register /codebase "C:\o.dll" then if i check my GUID in regedit.exe i see that i have it only in 32-bit registry path: HKEY_CLASSES_ROOT\CLSID\{... my guid is found here ....} instead of HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{... not found my guid ...} As a result i

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

electron-read-regedit

只谈情不闲聊 提交于 2019-12-16 12:38:40
前言 就是分享一下获取注册表的代码。 代码 const regedit = require('regedit') const regeditPath = 'HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\' // 开始获取注册表 regedit.list([regeditPath], function (err, data) { if (err) { console.log('err' + err) } // 遍历目录 for (let item in data) { // data[item].keys.length 长度 let keys = data[item].keys // 获取相对应的项目名字 // keys.length for (let i = 0; i <= keys.length; i++) { let keyName = keys[i] // console.log(keys[i]) // 防止空项目报错 if (keyName === undefined) { break } regedit.list([regeditPath + keyName], function (err, data) { if (err) { console.log('err' + err) } //

Create folder using cmd and passing formatted date from powershell

依然范特西╮ 提交于 2019-12-13 04:07:36
问题 I would like to create folder where it's name is date in specific format. Date format is from powershell echo result. How could I combine this two things? cmd.exe /c md \"%1\%%"date%%\"" /f and powershell get-date -format "{yyyy-MMM-dd HHmm} ? It must be in one line and starts with cmd . I will appreciate for any help. 回答1: This should do what you are looking in powershell: $format=get-date -format "yyyy-MMM-dd HHmm" New-Item -ItemType Directory -Path "C:\Folder\$format" This is the one liner

How do I use Python to retrieve Registry values?

眉间皱痕 提交于 2019-12-13 03:44:26
问题 I have written this code so far; from _winreg import * def val2addr(val): addr = '' for ch in val: addr += '%02x '% ord(ch) addr = addr.strip(' ').replace(' ', ':')[0:17] return addr def printNets(): net = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"+\ "\NetworkList\Signatures\Unmanaged" key = OpenKey(HKEY_LOCAL_MACHINE, net) print '\n[*] Networks You Have Joined.' for i in range(100): try: guid = EnumKey(key, i) netKey = OpenKey(key, str(guid)) (n, addr, t) = EnumValue(netKey, 5) (n, name,

Changing value of registry key with getRuntime().exec(cmd) does not change registry value even the operation ended successfully

喜欢而已 提交于 2019-12-13 01:15:02
问题 I'm trying to change registry value from my Java application. I use the command: LoudnessEqualizationToggle.execCmdNoReturn("reg add \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\MMDevices\\Audio\\Render\\"+guid+"\\FxProperties\"" + " /f /v \"{E0A941A0-88A2-4df5-8D6B-DD20BB06E8FB},4\" /t REG_DWORD /d \""+((activateLEOnKey) ? 1 : 0)+"\""); Where guid is {d348b8e8-3118-4a9c-9b43-422647b555ca} activateLEOnKey is boolean value execCmdNoReturn function: public static final

Unable to cast COM object (EXCEL)

旧时模样 提交于 2019-12-13 00:19:16
问题 My application just added a new function to allow export data into Excel. It worked fine on one device but when we implement it on the second one the following error appeared: Error Message: System.InvalidCastException: Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000

Iterate through Registry Subfolders

巧了我就是萌 提交于 2019-12-12 11:14:19
问题 I want to get all values of a registry path include the values of its subfolders. Right now i read the values of a single folder by this: const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv") strKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys For Each subkey In arrSubKeys msgbox subkey ' Just

Why can I add context menus for some extensions but no others using Reg and Java

泪湿孤枕 提交于 2019-12-11 19:27:23
问题 I'm trying to modify Windows registry so that the context menu for certain audio file extensions so that is an option to start my application on the said files. The application is written Java but wrapped in an exe wrapper using Winrun4j. Ive been using this example How do I make context menus for my software? to try and do this. The frustrating thing is the demo adds a context menu for .txt files and that works, and if I hack the code and add it to my application for .txt file it also works.