Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HKEY hKey;
- char szPath[0x100];
- GetModuleFileName(NULL, szPath, sizeof(szPath));
- RegCreateKeyEx(HKEY_LOCAL_MACHINE,
- "Software\Microsoft\Windows\CurrentVersion\Run",
- NULL,
- "C:\test.exe",
- REG_OPTION_NON_VOLATILE,
- KEY_SET_VALUE,
- NULL,
- &hKey,
- NULL);
- if (hKey)
- {
- RegSetValueEx(hKey, "Test", NULL, REG_SZ, (LPBYTE)szPath, strlen(szPath));
- RegCloseKey(hKey);
- }
Add Comment
Please, Sign In to add comment