BOOL AutoRunViaRegedit(wchar_t* path) {
HKEY hKey;
if (RegCreateKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey, NULL) == ERROR_SUCCESS) {
RegSetValueEx(hKey, L"Test", 0, REG_SZ, (LPBYTE)path, sizeof(path));
RegCloseKey(hKey);
}
return true;
}