Guest User

Untitled

a guest
Jan 20th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. HKEY hKey;
  2. char szPath[0x100];
  3. GetModuleFileName(NULL, szPath, sizeof(szPath));
  4. RegCreateKeyEx(HKEY_LOCAL_MACHINE,
  5. "Software\Microsoft\Windows\CurrentVersion\Run",
  6. NULL,
  7. "C:\test.exe",
  8. REG_OPTION_NON_VOLATILE,
  9. KEY_SET_VALUE,
  10. NULL,
  11. &hKey,
  12. NULL);
  13. if (hKey)
  14. {
  15. RegSetValueEx(hKey, "Test", NULL, REG_SZ, (LPBYTE)szPath, strlen(szPath));
  16. RegCloseKey(hKey);
  17. }
Add Comment
Please, Sign In to add comment