I'm not sure if this is the right forum, but i always seem to get redirected here with questions regarding .NET

Im using Managed C++ and im trying to edit a registry key.

using namespace System;
using namespace Microsoft::Win32;

int main()
{
	RegistryKey^ rk = Registry::CurrentUser;
	rk->OpenSubKey(L"Software\\Microsoft\\Command Processor", true);
	rk->SetValue(L"Autorun", L"VALUE");
	rk->Close();
}

This compiles, but it doesn't change the registry key. Whats wrong?

oh i guess OpenSubKey isn't void like i thought

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.