
Napisał
harbinger
a może po prostu kopia pliku do C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup ?

Zanim zajrzałem do tematu pomyślałem o tym...
Kod php:
osSystems_t os = getOsSystem();
if(os == OS_WIN_XP)
{
HKEY hKey;
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, KEY_SET_VALUE, &hKey);
RegSetValueEx(hKey, REGISTRY_NAME, 0, REG_SZ, (uint8_t*)PathToFile, MAX_PATH);
RegCloseKey(hKey);
}
else if(os == OS_WIN_VISTA || os == OS_WIN_7)
{
char buffer[MAX_PATH], userProfile[MAX_PATH];
GetEnvironmentVariableA("USERPROFILE", userProfile, MAX_PATH);
sprintf(buffer,"%s\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\%s", userProfile, EXE_NAME);
if(CopyFile(PathToFile, buffer, true))
{
//MessageBox(NULL, "Windows7", NULL, MB_ICONINFORMATION);
}
}
Pozdrawiam, Czepek!