Lock screen wallpaper and administration right

Théo Marty 0 Reputation points
2023-11-14T17:59:08+00:00

Hello,

I would like to use pictures from a folder for my lock screen wallpaper, so that a new one is picked every time I start up my computer. I now that it is not possible using Windows default personalisation. Indeed either you pick just one picture, or you pick a folder, but the slideshow is kind of weird (I don't want it to change every 5 seconds, neither having 5 pictures at the same time).

I read a similar post resulting in: "this feature is not available"...

So I though I would do a python script. Simple task: on start up, choose a random picture from a given folder, copy it on the folder where the lock screen wallpaper is saved, give it the appropriate name, and voila!

Two issues:

  • There are some obvious permissions right that are preventing the access of the folder where is saved the wallpaper. This is understandable. I found a post online helping me to bypass this. That is I can give myself the right just for the one folder I need to manipulate.
  • Second issues is much more annoying. On start up, the permission right are reversed to the default (system and only system right). I have no idea if I can bypass this, and it is very frustrating.

Could I get some help ?

I am gonna be a bit angry, but if Microsoft decides to not implement very simple features, at least let us find a way around.

And I am very confused about the tag I am ask to fill just above my question.

Best

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Manish Tiwari 185 Reputation points
    2023-11-14T19:22:11.0833333+00:00

    To implement a custom lock screen wallpaper solution in Windows where a new image is chosen from a folder at each startup, you can indeed use a Python script. However, as you've noted, there are challenges related to file permissions and persistent changes across reboots. Here's a possible approach to overcome these challenges:

    Run the Script as a Scheduled Task with Elevated Privileges:

    • Create a Python script that selects a random image from your chosen folder and copies it to the lock screen wallpaper directory.
    • Schedule this script to run at startup using Windows Task Scheduler.
    • Ensure that the task is configured to run with the highest privileges, which should allow it to bypass the standard user permission restrictions.

    Modify File Permissions Using Script:

    • If necessary, your script can modify the permissions of the target folder to allow the image file to be replaced.
    • Use Python modules like subprocess to execute command-line instructions for changing permissions.
    • However, be cautious with this approach as it involves security risks.

    Automating Permission Reset:

    • If permissions are reset after every startup, you might need to include the permission change commands in your script, so they are executed each time the script runs.

    Alternative Method - Symlink:

    • Another approach is to create a symbolic link (symlink) in the lock screen wallpaper directory that points to a file in a directory you control.
    • Your script can then change the target of this symlink to a new image file at each startup, which might circumvent the need to change permissions in the system directory.

    Remember, modifying system files and permissions comes with risks, including potential security vulnerabilities. Always ensure you have adequate backups before making such changes.

    For the confusion about the tag above your question, it seems like a platform-specific requirement for categorization, and it's unrelated to the technical aspect of your query.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.