Link to home
Create AccountLog in
.NET Programming

.NET Programming

--

Questions

--

Followers

Top Experts

Avatar of Hardi
Hardi

How to open a key in RegEdit?
Is there any command line to open a key/value in RegEdit?

eg. I have the registry value
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CommonFilesDir

I want to open RegEdit and it should show that value instead of the last key I opened.

I don't want any third party software. If there is no way, can we do it programatically in C#?

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


ASKER CERTIFIED SOLUTION
Avatar of Jinx_ITJinx_IT🇦🇺

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of HardiHardi

ASKER

Thanks a lot Jinx IT it really helps!

Just 1 more problem.
When I run the script it's alright, but when I do it in C# (my code below) I got UnauthorizedAccessException...
Any idea?
                RegistryKey tmpkey = Registry.CurrentUser.OpenSubKey(
@"Software\Microsoft\Windows\CurrentVersion\Applets\Regedit");
                tmpkey.SetValue("LastKey", @"My Computer\"+path);

Open in new window


Avatar of Jinx_ITJinx_IT🇦🇺

Nup sorry, cant help with that one :)

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


SOLUTION
Avatar of Jaime OlivaresJaime Olivares🇵🇪

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
.NET Programming

.NET Programming

--

Questions

--

Followers

Top Experts

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.