Jump to content

Trying to customize a .bat file

SpongeGorp

I am trying to write some code for a .bat file. I recently made my own desktop theme pack file which I can apply to any device easily. However, I realized I cannot apply a lock screen image to that theme pack, so I am trying to create a .bat file that applies the theme pack, but also apply a selected image to be set as the lock screen background. I have searched the web and have found nothing of use. Not even ChatGPT could help. I know there is a way of setting the lock screen wallpaper through the Windows Photos app. Can someone perhaps give me a command to set the selected image with the Windows Photos app or another alternative way that doesn't involve needing windows to be activated or requiring administrative permissions?

Link to comment
Share on other sites

Link to post
Share on other sites

a .bat file is basically executing command lines. Meaning if you find a way to change the lockscreen through the command line, you should be able to apply that to the .bat file.

 

Quick like that I'm not finding much in that direction, but there are ways to change the lockscreen's background through the registry. And there is a way to change the registry through command line. Hence, if you try that up, it might just work

 

https://winaero.com/how-to-change-default-lock-screen-image-in-windows-10/

(this is for the Default lockscreen background, not the USER's background. It's just to show the possibility)

 

https://www.windowscentral.com/how-edit-registry-using-command-prompt-windows-10

CPU: AMD Ryzen 3700x / GPU: Asus Radeon RX 6750XT OC 12GB / RAM: Corsair Vengeance LPX 2x8GB DDR4-3200
MOBO: MSI B450m Gaming Plus / NVME: Corsair MP510 240GB / Case: TT Core v21 / PSU: Seasonic 750W / OS: Win 10 Pro

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, TetraSky said:

(this is for the Default lockscreen background, not the USER's background. It's just to show the possibility)

I could be wrong, but I always though lockscreen was system wide anyways instead of local user.  Might explain why it's like that.

 

 

Anyways @SpongeGorp it should be something like this (I haven't tried, so please be careful when running)

 

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization

REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization /v LockScreenImage /t REG_SZ /d "C:\Images\Image.jpg"

May or maynot need the quotes, I don't feel like testing...but you can experiment and see...just be careful when modifying registry.

 

You might even be able to ask ChatGPT...like "Tell me the registry edit required to change lock screen"

3735928559 - Beware of the dead beef

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, wanderingfool2 said:

I could be wrong, but I always though lockscreen was system wide anyways instead of local user.  Might explain why it's like that.

I thought so too, but then I tried changing the registry for all users to a different image and it didn't do anything. Maybe I needed to reboot, I dunno. Tried asking Bing, it gave me almost the same answers as you posted, meaning it "probably" works. There's an added /f flag at the end to ensure it overwrites existing entries if they exist.

 

For current users

reg add "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v LockScreenImage /t REG_SZ /d "C:\path\to\your\image.jpg" /f

For all users

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v LockScreenImage /t REG_SZ /d "C:\path\to\your\image.jpg" /f

CPU: AMD Ryzen 3700x / GPU: Asus Radeon RX 6750XT OC 12GB / RAM: Corsair Vengeance LPX 2x8GB DDR4-3200
MOBO: MSI B450m Gaming Plus / NVME: Corsair MP510 240GB / Case: TT Core v21 / PSU: Seasonic 750W / OS: Win 10 Pro

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×