Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Coded by Aker15
- * Add file to startup.
- */
- #include "stdafx.h" // erase if not using MVC++
- #include <stdio.h>
- #include <Windows.h>
- int _tmain(int argc, _TCHAR* argv[])
- {
- HKEY hkey;
- const char* szPath = "Robot";
- //DWORD fName = GetModuleFileName(NULL, (TCHAR *)szPath, sizeof(szPath));
- if(RegCreateKey(HKEY_CURRENT_USER, L"Software//Microsoft//Windows//CurrentVersion//Run", &hkey) == 0)
- {
- RegSetValueEx((HKEY)hkey, L"RoBoT", NULL, REG_SZ, (BYTE *)szPath, strlen(szPath));
- }
- else
- {
- printf("%s", GetLastError());
- }
- puts("Successful!");
- RegCloseKey(hkey);
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement