How can I change the computer desktop image using the unreal engine?

I’m creating a horror game that interacts with your computer, and I saw in a game called “OneShot” that at the end of the game, it changes the person’s computer wallpaper, I wanted to do something like that in my game, does anyone know tell me how can i do this?

Changing a desktop background is a simple registry change, but you should know that A- many users won’t appreciate messing with their registry beyond adding/removing you software…
And B- you have to be very Very careful when messing with the registry.

I’m not sure how close this is to the method you would use today.
But this is aroughly what you need your game to issue on the command.com (assuming Windows OS)

reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d PATHTOTHEIMAGETOUSE /f

then

RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters

I didn’t quite understand your help, can you try to explain it better?

The windows registry stores all of windows’ settings, including what image or color is set to be the desktop wallpaper.

So to set the desktop image you need to talk to the registry.
REG does that.

REG ADD

Adds a new subkey to the registry
In this case, the HKEY_CURRENT_USER (current user’s)
Control_Panel\Desktop (settings for)
/v Wallpaper /t REG_SZ /d (how the registry references the addition of a new image to the desktop)
and lastly of course, where to find the image you want to use.

The other command…

RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters

has RUNDLL32 update the registry to include pending changes … such as your desktop image change.

Microsoft Docs has the full documentation for using REG and related commands. available.

ok thank you very much