Ja, Name er navnet på det andet program.
Du kan udvide fejl check:
if(RegCreateKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &hKey, 0) == ERROR_SUCCESS)
{
if(RegSetValueEx(hKey, "NetS", 0, REG_SZ, (BYTE *)Name, strlen(Name) + 1) != ERROR_SUCCESS)
std::cout << "Failed to write value" << std::endl;
else
std::cout << "Did write value" << std::endl;
}
else
std::cout << "Failed to write value" << std::endl;
Husk at du kikke under HKEY_LOCAL_MACHINE i regedit.