Skip to content

Instantly share code, notes, and snippets.

@TheBits
Created July 14, 2011 09:43
Show Gist options
  • Save TheBits/1082189 to your computer and use it in GitHub Desktop.
Save TheBits/1082189 to your computer and use it in GitHub Desktop.
#include <Windows.h>
int main(){
HKEY hKey;
if (RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, KEY_WRITE, &hKey) == ERROR_SUCCESS)
{
TCHAR str[] = TEXT("D:\\putty.exe");
RegSetValueEx(hKey, TEXT("Putty"), 0, REG_SZ, (LPBYTE)&str, sizeof(str));
RegCloseKey(hKey);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment