Computing: Free Pascal Programming

Programming Home   Home   Contact

Copy of the Windows 10 lockscreen pictures to a user directory (lspics).


Description: Microsoft Windows automatically downloads pictures, that will be used as wallpaper for the lockscreen, on a regular basis and thus the screen background picture is periodically changed. These pictures are (temporarily) saved to the directory
    C:\Users\USERNAME\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets
where USERNAME is your Windows login user name. These pictures are sometimes really amazing and perhaps you might want to keep them. To do so, two things to do: 1. Copying the files from the lockscreen directory to some user directory (e.g. a subfolder in your Pictures library); 2. renaming the files, adding .jpg as file extension. These two things actually are, what the very simple command line program "lspics" does.
You can run the program in Command Prompt, with the possibility to specify command line arguments such as the directory, where you want to save the pictures or how to rename the files. You can also run it by simply double-clicking the executable; in this case, default parameters will be used. Have a look at the help.txt file, included in the download archive or run the program as "lspics -h".

Improvement: I suppose that Windows 10 removes the files in stored in the lockscreen pictures directory regularily, but that some of the files there are kept. Thus, keeping track of the files copied would avoid to copy some files each time, that the program is executed. Another improvement would be, to only copy the photos and ignoring these "smaller pictures without real interest".

Free Pascal features: Reading and writing text files (classic Pascal). Command line arguments, executing external programs, the directory and file handling procedures of the SysUtils unit (classic Pascal).

Screenshot:

Windows lockscreen pictures: Content of the lockscreen pictures directory
 
Windows lockscreen pictures: Pictures copied by the 'lspics' program to a user directory