• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Windows spotlight images (Lock screen)

Solaris17

Dainty Moderator
Staff member
Joined
Aug 16, 2005
Messages
19,843 (4.12/day)
Likes
6,927
Location
Florida
System Name Venslar
Processor I9 7980XE
Motherboard MSI x299 Tomahawk Arctic
Cooling EKWB L360 R2.0
Memory 32GB Corsair DDR4 3000mhz
Video Card(s) Gigabyte 1080TI
Storage 2x 2TB Micron SSDs | 1x ADATA 128SSD | 1x Drevo 256SSD | 1x 1TB 850 EVO | 1x 250GB 960 EVO
Display(s) 3x AOC Q2577PWQ (2k IPS)
Case Inwin 303 White (Thermaltake Ring 120mm Purple accent)
Audio Device(s) Realtek ALC 1220 on Audio-Technica ATH-AG1
Power Supply Seasonic 1050W Snow
Mouse Roccat Tyon White
Keyboard Ducky Shine 6 Snow White
Software Windows 10 x64 Pro
#1
This is really dumb, but if you are like me and use spotlight for your windows lock screen images, I actually tend to like some of them alot. They rotate it seems every few days but it doesn't seem to delete them as often as it gets new ones.

With that said I couldnt find anything similar online so I made a script that would pull the files from the folder buried in app data that keeps the files. They dont have an extension normally so I append the JPG extension too them.

I create a folder on your desktop called spotlight and copy the files too it then run the conversion.

I didn't spend forever on this so be nice but otherwise;

Enjoy

Code for the crazies:
Code:
@Echo off
title Spotlight Image Converter
cls

:checkPrivileges
:: Check for Admin by accessing protected stuff. This calls net(#).exe and can stall if we don't kill it later.
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto menu) else ( goto getPrivileges ) 

:getPrivileges
:: Write vbs in temp to call batch as admin.
if '%1'=='ELEV' (shift & goto menu)                               
for /f "delims=: tokens=*" %%A in ('findstr /b ::- "%~f0"') do @Echo(%%A
setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
Echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs" 
Echo UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs" 
"%temp%\OEgetPrivileges.vbs" 
exit /B

:menu
Echo Windows 10 Lock screen image converter
Echo.
Echo Brought to you by Solaris17 of TPU
Echo.
Echo This will make a folder on your desktop called "Spotlight"
Echo.
Echo It will copy the lockscreen images to the folder then convert them to JPEG format.
Echo.
Echo Let me know when you are ready.
Echo.
Pause

goto copy

:copy
@echo off
CLS
Echo.
Echo Converting and copy in progress...
Echo.
mkdir %userprofile%\Desktop\Spotlight > nul 2>&1
timeout 5 >nul
robocopy %userprofile%\appdata\local\packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets\ %userprofile%\Desktop\Spotlight /copyall /E > nul 2>&1
ren %userprofile%\Desktop\Spotlight\* *.jpg > nul 2>&1
Echo Done!!
Echo.
pause
 

Attachments

Solaris17

Dainty Moderator
Staff member
Joined
Aug 16, 2005
Messages
19,843 (4.12/day)
Likes
6,927
Location
Florida
System Name Venslar
Processor I9 7980XE
Motherboard MSI x299 Tomahawk Arctic
Cooling EKWB L360 R2.0
Memory 32GB Corsair DDR4 3000mhz
Video Card(s) Gigabyte 1080TI
Storage 2x 2TB Micron SSDs | 1x ADATA 128SSD | 1x Drevo 256SSD | 1x 1TB 850 EVO | 1x 250GB 960 EVO
Display(s) 3x AOC Q2577PWQ (2k IPS)
Case Inwin 303 White (Thermaltake Ring 120mm Purple accent)
Audio Device(s) Realtek ALC 1220 on Audio-Technica ATH-AG1
Power Supply Seasonic 1050W Snow
Mouse Roccat Tyon White
Keyboard Ducky Shine 6 Snow White
Software Windows 10 x64 Pro
#2
I updated this to fix an issue where images already in the folder would be swapped back to no extension making them unreadable again.

CODE:
Code:
@Echo off
title Spotlight Image Converter v2
cls

:checkPrivileges
:: Check for Admin by accessing protected stuff. This calls net(#).exe and can stall if we don't kill it later.
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto menu) else ( goto getPrivileges )

:getPrivileges
:: Write vbs in temp to call batch as admin.
if '%1'=='ELEV' (shift & goto menu)                             
for /f "delims=: tokens=*" %%A in ('findstr /b ::- "%~f0"') do @Echo(%%A
setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
Echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
Echo UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
"%temp%\OEgetPrivileges.vbs"
exit /B

:menu
Echo Windows 10 Lock screen image converter
Echo.
Echo Brought to you by Solaris17 of TPU
Echo.
Echo This will make a folder on your desktop called "Spotlight"
Echo.
Echo It will copy the lockscreen images to the folder then convert them to JPEG format.
Echo.
Echo Let me know when you are ready.
Echo.
Pause

goto copy

:copy
@echo off
CLS
Echo.
Echo Converting and copy in progress...
Echo.
mkdir "%userprofile%\Desktop\Spotlight" > nul 2>&1
mkdir "%userprofile%\Desktop\Spotlight\Converted" > nul 2>&1
timeout 5 >nul
robocopy %userprofile%\appdata\local\packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets\ "%userprofile%\Desktop\Spotlight" /copyall /E > nul 2>&1
ren %userprofile%\Desktop\Spotlight\* *.jpg > nul 2>&1
move "%userprofile%\Desktop\Spotlight\*.jpg" "%userprofile%\Desktop\Spotlight\Converted" > nul 2>&1
Echo Done!!
Echo.
pause
 

Attachments

Top