regedit

Setting and unsetting registry using regedit (replace registry value from 1 to 0)

久未见 提交于 2019-12-11 14:05:55
问题 I am trying to set and unset registry with values 1 and 0 respectively. I am using regedit npm package to achieve this. Upon unset,I want this registry value to be 0. I see the function UnsetRegistryValue being called, but it doesn't set the value to 0. Please note, already registry value set to 1. I want to replace registry value **set registry ** function setRegistryValue(){ regedit.putValue({ 'HKLM\\System\\CurrentControlSet\\Control\\Session Manager\\Environment': { 'XYZ': { value: '1',

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

Can I get an exit code from running regedit /s?

我的梦境 提交于 2019-12-11 04:14:48
问题 I have a script that changes a registry value, before doing that, it makes a backup of the registry key using regedit /e to create a .reg file. If the script is run a second time and the .reg backup file exists, I am asking the user if they want to add their backup back into the registry. Because I don't want to confuse users who will have no real idea of whats happening with extra prompts they might not understand, I am using the following code to do this with out asking the user if they

Is it possible to open regedit and navigate to straight to a specific key using process.start?

有些话、适合烂在心里 提交于 2019-12-11 01:34:34
问题 I'm making a small tool that can write a key in registry, and a tiny part of it just for convenience would be to navigate to that key instantly with the click of a button. I know how to open regedit.exe already but is there a way to instantly navigate to the key i need? I'm trying with System.Diagnostics.Process.Start("regedit.exe" + "c/ HKEY_LOCAL_MACHINE"); but i think it's just trying to write a key into registry. Thanks in advance! Edit: @Arran -Actually the tool is for myself mainly. I'm

Right-click command pass argument to python script

五迷三道 提交于 2019-12-08 02:55:28
I am rewriting a python script at work and part of what it does is searched inside a folder that I right-click on for image sequences.. The python side of things I think I'm good on, but the right click not so much. I can create a right click button in the regedit but I am unsure of how to pass an argument from where I right-clicked on the folder to my python script. I want the argument to have the path to the folder. I found a post about this but it is not working for me.. maybe because they were making it on xp?? I'm unsure.(Link below) Copy as path in windows context menu I also found this

Block .EXE in Windows Firewall with context menu

泪湿孤枕 提交于 2019-12-07 12:14:30
问题 I got the following bit of code for a .REG file that adds "Add to Firewall" to the context menu on right clicking on a .EXE file. It simply creates an Outbound Rule in the windows firewall for that specific file you had selected instead of doing it manually. Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\exefile\shell] [HKEY_CLASSES_ROOT\exefile\shell\Add To Firewall] [HKEY_CLASSES_ROOT\exefile\shell\Add To Firewall\command] @="netsh advfirewall firewall add rule name=\"%1\" dir=out

Receiving arguments from Windows Context menu

≡放荡痞女 提交于 2019-12-07 09:01:07
问题 I have done this before but for the life of me can't remember how to do this... In my explorer context menu I added a new entry (go to regedit...go to HKEY_CLASSES_ROOT...bla bla bla)... Now when I click on my option I want to pass in the file path, file name, those kind of things to my application...and then use it there? 回答1: The default value of the .ext\shell\open\command key should contain the path to your .exe with the "%1" argument. Explorer substitutes that with the full path to the

Windows 10 | regedit | exefile shell command (firewall add rule) - not running

夙愿已清 提交于 2019-12-06 19:43:27
Definitions: using windows 10/64bit firewall is blocking all in/out traffic - except added rules (allow in/out) actual user-account is administrator tested with all user-account-control (uac) settings: from always to never Problem: I have a script that worked fine with windows 7/64 bit, it adds right-click context menu items to .exe files, to add a firewall rule for them: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\exefile\shell] [HKEY_CLASSES_ROOT\exefile\shell\FirewallAllowIncoming] [HKEY_CLASSES_ROOT\exefile\shell\FirewallAllowIncoming\command] @="netsh advfirewall firewall add

Block .EXE in Windows Firewall with context menu

微笑、不失礼 提交于 2019-12-05 13:31:43
I got the following bit of code for a .REG file that adds "Add to Firewall" to the context menu on right clicking on a .EXE file. It simply creates an Outbound Rule in the windows firewall for that specific file you had selected instead of doing it manually. Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\exefile\shell] [HKEY_CLASSES_ROOT\exefile\shell\Add To Firewall] [HKEY_CLASSES_ROOT\exefile\shell\Add To Firewall\command] @="netsh advfirewall firewall add rule name=\"%1\" dir=out action=block program=\"%1\"" http://oi46.tinypic.com/2rgnxaf.jpg My problem is that the following

Receiving arguments from Windows Context menu

荒凉一梦 提交于 2019-12-05 12:44:12
I have done this before but for the life of me can't remember how to do this... In my explorer context menu I added a new entry (go to regedit...go to HKEY_CLASSES_ROOT...bla bla bla)... Now when I click on my option I want to pass in the file path, file name, those kind of things to my application...and then use it there? The default value of the .ext\shell\open\command key should contain the path to your .exe with the "%1" argument. Explorer substitutes that with the full path to the file. Which you can read in your .exe through the Main() method argument or Environment.GetCommandLineArgs().